spielwiese
Last change
on this file since 672783 was
a07e45,
checked in by Hans Schönemann <hannes@…>, 14 years ago
|
*hannes: no mp_set_memory_functions for Singular
git-svn-id: file:///usr/local/Singular/svn/trunk@12030 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | /* $Id: initgmp.cc,v 1.5 2009-07-28 14:51:07 Singular 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 |
---|
22 | void * mgAllocBlock( size_t t) |
---|
23 | { |
---|
24 | return mmDBAllocBlock(t,"gmp",0); |
---|
25 | } |
---|
26 | void mgFreeBlock( void* a, size_t t) |
---|
27 | { |
---|
28 | mmDBFreeBlock(a,t,"gmp",0); |
---|
29 | } |
---|
30 | void * 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 | |
---|
38 | int initializeGMP() |
---|
39 | { |
---|
40 | #ifdef USE_MEMUTIL |
---|
41 | static int initialized = 0; |
---|
42 | |
---|
43 | if ( ! initialized ) |
---|
44 | { |
---|
45 | initialized = 1; |
---|
46 | #ifdef USE_OLD_MEMMAN |
---|
47 | mp_set_memory_functions( getBlock, reallocBlock, freeBlock ); |
---|
48 | #else |
---|
49 | #ifdef MDEBUG |
---|
50 | mp_set_memory_functions( mgAllocBlock, mgReallocBlock, mgFreeBlock ); |
---|
51 | #else |
---|
52 | #ifndef SINGULAR |
---|
53 | // do not initialize this within Singular: |
---|
54 | mp_set_memory_functions( mmAllocBlock, mmReallocBlock, mmFreeBlock ); |
---|
55 | #endif |
---|
56 | #endif |
---|
57 | #endif |
---|
58 | } |
---|
59 | #endif |
---|
60 | return 1; |
---|
61 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.