source: git/factory/initgmp.cc @ 493c477

spielwiese
Last change on this file since 493c477 was 493c477, checked in by Jens Schmidt <schmidt@…>, 27 years ago
o header fixed git-svn-id: file:///usr/local/Singular/svn/trunk@404 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.0 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: initgmp.cc,v 1.3 1997-06-19 12:22:52 schmidt Exp $ */
3
4#include <config.h>
5
6#include "cf_gmp.h"
7
8#include "assert.h"
9
10#include "cf_defs.h"
11#ifdef USE_MEMUTIL
12#ifdef USE_OLD_MEMMAN
13#include "memutil.h"
14#else
15#include "memman.h"
16#endif
17#endif
18
19#ifdef USE_MEMUTIL
20#ifndef USE_OLD_MEMMAN
21#ifdef MDEBUG
22void * mgAllocBlock( size_t t)
23{
24  return mmDBAllocBlock(t,"gmp",0);
25}
26void mgFreeBlock( void* a, size_t t)
27{
28  mmDBFreeBlock(a,t,"gmp",0);
29}
30void * mgReallocBlock( void* a, size_t t1, size_t t2)
31{
32  return mmDBReallocBlock(a,t1,t2,"gmp",0);
33}
34#endif
35#endif
36#endif
37
38int initializeGMP()
39{
40  static int initialized = 0;
41
42  if ( ! initialized ) {
43    initialized = 1;
44#ifdef USE_MEMUTIL
45#ifdef USE_OLD_MEMMAN
46    mp_set_memory_functions( getBlock, reallocBlock, freeBlock );
47#else
48#ifdef MDEBUG
49    mp_set_memory_functions( mgAllocBlock, mgReallocBlock, mgFreeBlock );
50#else
51    mp_set_memory_functions( mmAllocBlock, mmReallocBlock, mmFreeBlock );
52#endif
53#endif
54#endif
55  }
56  return 1;
57}
Note: See TracBrowser for help on using the repository browser.