Changeset 8fe650 in git for omalloc/omAllocDecl.h
- Timestamp:
- May 2, 2006, 1:39:03 PM (17 years ago)
- Branches:
- (u'spielwiese', 'd0474371d8c5d8068ab70bfb42719c97936b18a6')
- Children:
- fc11f4583f0780c252a03d9b7079efbb0029dbce
- Parents:
- c551fdc7a02e90492400d97decfdc027e6af25a9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
omalloc/omAllocDecl.h
rc551fdc r8fe650 4 4 * Author: obachman (Olaf Bachmann) 5 5 * Created: 11/99 6 * Version: $Id: omAllocDecl.h,v 1. 8 2001-04-30 09:02:00Singular Exp $6 * Version: $Id: omAllocDecl.h,v 1.9 2006-05-02 11:38:43 Singular Exp $ 7 7 *******************************************************************/ 8 8 #ifndef OM_ALLOC_DECL_H 9 9 #define OM_ALLOC_DECL_H 10 11 #ifdef OM_NDEBUG 12 #if (SIZEOF_LONG == 8) 13 #define OM_T_FREE1 14 #define OM_T_FREE3 15 #define OM_T_STR 16 #define OM_T_ALLOC 17 #define OM_T_REALLOC 18 #endif 19 #endif 10 20 11 21 … … 19 29 #endif 20 30 21 #if !defined(OM_EMULATE_OMALLOC) && !defined(OM_NDEBUG) && (defined(OM_CHECK) || (defined(OM_HAVE_TRACK) && defined(OM_TRACK)))31 #if (!defined(OM_EMULATE_OMALLOC) && !defined(OM_NDEBUG) && (defined(OM_CHECK) || (defined(OM_HAVE_TRACK) && defined(OM_TRACK)))) || defined(OM_T1) 22 32 23 33 /******************************************************************* … … 39 49 #endif 40 50 51 #if !defined(OM_T_ALLOC) 41 52 #define omTypeAllocBin(type,addr,bin) addr=(type)_omDebugAlloc(bin,OM_FBIN|_OM_FKEEP,OM_CTFL) 42 53 #define omTypeAlloc0Bin(type,addr,bin) addr=(type)_omDebugAlloc(bin,OM_FBIN|OM_FZERO|_OM_FKEEP,OM_CTFL) … … 49 60 #define omAlloc0(size) _omDebugAlloc((void*)(size),OM_FSIZE|OM_FZERO|_OM_FKEEP,OM_CTFL) 50 61 62 #define omalloc(size) _omDebugAlloc((void*)(size),OM_FSIZE|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL) 63 #define omalloc0(size) _omDebugAlloc((void*)(size),OM_FSIZE|OM_FZERO|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL) 64 #define omcalloc(n,size)_omDebugAlloc((void*) ((size)*n),OM_FSIZE|OM_FZERO|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL) 65 66 #else 67 #define omTypeAllocBin(type,addr,bin) __omTypeAllocBin(type,addr,bin) 68 #define omTypeAlloc0Bin(type,addr,bin) __omTypeAlloc0Bin(type,addr,bin) 69 #define omAllocBin(bin) _omAllocBin(bin) 70 #define omAlloc0Bin(bin) _omAlloc0Bin(bin) 71 72 #define omTypeAlloc(type,addr,size) __omTypeAlloc(type,addr,size) 73 #define omTypeAlloc0(type,addr,size) __omTypeAlloc0(type,addr,size) 74 #define omAlloc(size) _omAlloc(size) 75 #define omAlloc0(size) _omAlloc0(size) 76 77 #define omalloc(size) _omalloc(size) 78 #define omalloc0(size) _omalloc0(size) 79 #define omcalloc(n,size)_omalloc0(n*size) 80 81 #endif 82 83 #if !defined(OM_T_REALLOC) 51 84 #define omTypeReallocBin(o_addr,o_bin,type,addr,bin) addr=(type)_omDebugRealloc(o_addr,o_bin,bin,OM_FBIN|_OM_FKEEP,OM_FBIN|_OM_FKEEP,OM_CTFL) 52 85 #define omTypeRealloc0Bin(o_addr,o_bin,type,addr,bin) addr=(type)_omDebugRealloc(o_addr,o_bin,bin,OM_FBIN|_OM_FKEEP,OM_FBIN|OM_FZERO|_OM_FKEEP,OM_CTFL) … … 64 97 #define omRealloc0(addr,size) _omDebugRealloc(addr,NULL,(void*)(size),_OM_FKEEP,OM_FSIZE|OM_FZERO,OM_CTFL) 65 98 66 #define omFreeBinAddr(addr) _omDebugFree(addr,NULL,OM_FBINADDR|_OM_FKEEP,OM_CFL)67 #define omFreeBin(addr,bin) _omDebugFree(addr,bin,OM_FBIN|_OM_FKEEP,OM_CFL)68 #define omFreeSize(addr,size) _omDebugFree(addr,(void*)(size),OM_FSIZE|_OM_FKEEP,OM_CFL)69 #define omFree(addr) _omDebugFree(addr,0,0,OM_CFL)70 71 72 #define omalloc(size) _omDebugAlloc((void*)(size),OM_FSIZE|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL)73 #define omalloc0(size) _omDebugAlloc((void*)(size),OM_FSIZE|OM_FZERO|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL)74 #define omcalloc(n,size)_omDebugAlloc((void*) ((size)*n),OM_FSIZE|OM_FZERO|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL)75 76 99 #define omreallocSize(addr,o_size,size) _omDebugRealloc(addr,(void*)(o_size),(void*)(size),OM_FSIZE|OM_FSLOPPY|_OM_FKEEP,OM_FSIZE|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL) 77 100 #define omrealloc0Size(addr,o_size,size)_omDebugRealloc(addr,(void*)(o_size),(void*)(size),OM_FSIZE|OM_FSLOPPY|_OM_FKEEP,OM_FSIZE|OM_FZERO|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL) … … 79 102 #define omrealloc0(addr,size) _omDebugRealloc(addr,NULL,(void*)(size),OM_FSLOPPY|_OM_FKEEP,OM_FSIZE|OM_FZERO|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL) 80 103 104 #else 105 #define omTypeReallocBin(o_addr,o_bin,type,addr,bin) __omTypeReallocBin(o_addr,o_bin,type,addr,bin) 106 #define omTypeRealloc0Bin(o_addr,o_bin,type,addr,bin) __omTypeRealloc0Bin(o_addr,o_bin,type,addr,bin) 107 #define omReallocBin(o_addr,o_bin,bin) _omReallocBin(o_addr,o_bin,bin) 108 #define omRealloc0Bin(o_addr,o_bin,bin) _omRealloc0Bin(o_addr,o_bin,bin) 109 110 #define omTypeReallocSize(o_addr,o_size,type,addr,size) __omTypeReallocSize(o_addr,o_size,type,addr,size) 111 #define omTypeRealloc0Size(o_addr,o_size,type,addr,size) __omTypeRealloc0Size(o_addr,o_size,type,addr,size) 112 #define omReallocSize(addr,o_size,size) _omReallocSize(addr,o_size,size) 113 #define omRealloc0Size(addr,o_size,size) _omRealloc0Size(addr,o_size,size) 114 115 #define omTypeRealloc(o_addr,type,addr,size) __omTypeRealloc(o_addr,type,addr,size) 116 #define omTypeRealloc0(o_addr,type,addr,size) __omTypeRealloc0(o_addr,type,addr,size) 117 #define omRealloc(addr,size) _omRealloc(addr,size) 118 #define omRealloc0(addr,size) _omRealloc0(addr,size) 119 120 #define omreallocSize(addr,o_size,size) _omreallocSize(addr,o_size,size) 121 #define omrealloc0Size(addr,o_size,size)_omrealloc0Size(addr,o_size,size) 122 #define omrealloc(addr,size) _omrealloc(addr, size) 123 #define omrealloc0(addr,size) _omrealloc0(addr, size) 124 125 #endif 126 127 #if !defined(OM_T_FREE1) 128 #define omFreeBinAddr(addr) _omDebugFree(addr,NULL,OM_FBINADDR|_OM_FKEEP,OM_CFL) 129 #define omFreeBin(addr,bin) _omDebugFree(addr,bin,OM_FBIN|_OM_FKEEP,OM_CFL) 130 #else 131 #define omFreeBinAddr(addr) __omFreeBinAddr(addr) 132 #define omFreeBin(addr,bin) __omFreeBinAddr(addr) 133 #endif 134 135 #if !defined(OM_T_FREE2) 136 #define omFreeSize(addr,size) _omDebugFree(addr,(void*)(size),OM_FSIZE|_OM_FKEEP,OM_CFL) 81 137 #define omfreeSize(addr,size) _omDebugFree(addr,(void*)(size),OM_FSIZE|OM_FSLOPPY|_OM_FKEEP,OM_CFL) 138 #else 139 #define omFreeSize(addr,size) __omFreeSize(addr,size) 140 #define omfreeSize(addr,size) do {if (addr && size) omFreeSize(addr, size);} while (0) 141 #endif 142 143 #if !defined(OM_T_FREE3) 144 #define omFree(addr) _omDebugFree(addr,0,0,OM_CFL) 82 145 #define omfree(addr) _omDebugFree(addr,NULL,OM_FSLOPPY|_OM_FKEEP,OM_CFL) 83 146 #else 147 #define omFree(addr) __omFree(addr) 148 #define omfree(addr) do {if (addr) omFree(addr);} while (0) 149 #endif 150 151 #if !defined(OM_T_STR) 84 152 #define omStrDup(s) _omDebugStrDup(s,OM_TFL) 85 153 #define omMemDup(addr) _omDebugMemDup(addr,_OM_FKEEP,OM_CTFL) 154 #else 155 #define omStrDup(s) _omStrDup(s) 156 #define omMemDup(s) _omMemDup(s) 157 #endif 86 158 87 159 #define omDebugBinAddr(addr) _omDebugAddr(addr,NULL,OM_FBINADDR,OM_CFL)
Note: See TracChangeset
for help on using the changeset viewer.