Changeset f8dcbcb in git for Singular/mmstd.c
- Timestamp:
- Jan 27, 2001, 6:04:59 PM (23 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 995ba8e72c52d5e7ce134eb888bb7682e01af581
- Parents:
- d83977461ed45e8d1baf489f2bd39e88bd603aa3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/mmstd.c
rd83977 rf8dcbcb 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mmstd.c,v 1. 2 2001-01-24 16:54:04 levandovExp $ */4 /* $Id: mmstd.c,v 1.3 2001-01-27 17:04:59 obachman Exp $ */ 5 5 /* 6 * ABSTRACT: standard version of C-memory management alloc func 6 * ABSTRACT: standard version of C-memory management alloc func 7 * i.e. (malloc/realloc/free) 7 8 */ 8 9 9 10 #include "mod2.h" 10 11 11 /* We define those, so that our values of 12 OM_TRACK and OM_CHECK are used */ 12 #define OM_NO_MALLOC_MACROS 13 #include "omalloc.h" 14 15 // we provide these functions, so that the settings of OM_CHECK 16 // and OM_TRACK are used, but only provide them if omalloc is not based 17 // on them 18 #ifndef OMALLOC_USES_MALLOC 13 19 14 20 // define this so that all addr allocated there are marked 15 21 // as static, i.e. not metioned by omPrintUsedAddr 16 #ifndef ix86_Win17 22 #define OM_MALLOC_MARK_AS_STATIC 18 23 #include <omalloc.c> 19 #else20 #include <stdlib.h>21 void freeSize(void* addr, size_t size)22 {23 if (addr) free(addr);24 }25 26 void* reallocSize(void* old_addr, size_t old_size, size_t new_size)27 {28 if (old_addr && new_size)29 {30 return realloc(old_addr, new_size);31 }32 else33 {34 freeSize(old_addr, old_size);35 return malloc(new_size);36 }37 }38 24 #endif
Note: See TracChangeset
for help on using the changeset viewer.