Changeset 5f6d137 in git
- Timestamp:
- Mar 19, 2009, 11:34:00 AM (14 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- 2e5f59996ea62adb5223bd59681c6fe2d5fcfa86
- Parents:
- f9d9013b894bb374c9ef74f2cfecb1689aa109b9
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/mminit.cc
rf9d901 r5f6d137 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mminit.cc,v 1. 3 2009-03-18 18:49:55Singular Exp $ */4 /* $Id: mminit.cc,v 1.4 2009-03-19 10:34:00 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: init of memory management … … 32 32 exit(1); 33 33 } 34 #if defined(HAVE_STATIC)35 void* si_malloc(size_t size);36 #endif37 34 } 38 35 … … 48 45 mp_set_memory_functions(omMallocFunc,omReallocSizeFunc,omFreeSizeFunc); 49 46 #else 50 #ifdef HAVE_STATIC51 mp_set_memory_functions(si_malloc,reallocSize,freeSize);52 #else53 47 mp_set_memory_functions(malloc,reallocSize,freeSize); 54 #endif55 56 48 #endif 57 49 om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc; -
kernel/mmstd.c
rf9d901 r5f6d137 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mmstd.c,v 1. 7 2009-03-18 18:53:28Singular Exp $ */4 /* $Id: mmstd.c,v 1.8 2009-03-19 10:34:00 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: standard version of C-memory management alloc func … … 18 18 // on them 19 19 // already provided in libomalloc 20 #if defined(HAVE_STATIC)21 void* si_malloc(size_t size)22 {23 void* addr;24 if (size == 0) size = 1;25 26 omTypeAllocAligned(void*, addr, size);27 return addr;28 }29 30 void freeSize(void* addr, size_t size)31 {32 if (addr) omFreeSize(addr, size);33 }34 35 void* reallocSize(void* old_addr, size_t old_size, size_t new_size)36 {37 if (old_addr && new_size)38 {39 void* new_addr;40 omTypeReallocAlignedSize(old_addr, old_size, void*, new_addr, new_size);41 return new_addr;42 }43 else44 {45 freeSize(old_addr, old_size);46 return si_malloc(new_size);47 }48 }49 #else50 20 #if !defined(OMALLOC_USES_MALLOC) && !defined(X_OMALLOC) 51 21 /* in mmstd.c, for some architectures freeSize() unconditionally uses the *system* free() */ … … 80 50 81 51 #endif 82 #endif83 52
Note: See TracChangeset
for help on using the changeset viewer.