- Timestamp:
- Feb 6, 2022, 2:03:55 PM (2 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- d4f723620e6a8e1eab6e3b1351719895af39a245
- Parents:
- 6a57089b3e776d07691d5d44f2130534d7a2c793
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
omalloc/xalloc.h
r6a57089 r04e6cf 82 82 83 83 static inline void * omAlloc0(size_t s) 84 { void *d= omAlloc(s);memset(d,0,s); return d; }84 { void *d=malloc(s);memset(d,0,s); return d; } 85 85 static inline void * omalloc0(size_t s) 86 { if (s!=0) { void *d=omAlloc(s);memset(d,0,s); return d;} else return NULL; } 87 88 static inline void *omRealloc(void *d, size_t ns) 89 { if (d==NULL) return omAlloc(ns); 90 else 91 return realloc(d,ns); 92 } 93 #define omReallocAligned(A,B) omRealloc(A,B) 94 static inline void *omReallocSize(void *d, __attribute__((unused)) size_t os, size_t ns) 95 { if (d==NULL) return omAlloc(ns); 96 else 97 return realloc(d,ns); 98 } 86 { if (s!=0) { void *d=malloc(s);memset(d,0,s); return d;} else return NULL; } 99 87 100 88 static inline void *omRealloc0Size(void *d, __attribute__((unused)) size_t os, size_t ns) … … 173 161 #define omPrintBinStats(F) 174 162 #define omMarkMemoryAsStatic() 175 #define omFreeBin(P,B) omFree(P)176 #define omfreeSize(P,S) omFreeSize(P,S)177 #define omFreeFunc omFree178 #define omFreeBinAddr(P) omFree(P)179 #define omrealloc(A,NS) omRealloc(A,NS)180 #define omreallocSize(A,OS,NS) omRealloc(A,NS)163 #define omFreeBin(P,B) free(P) 164 #define omfreeSize(P,S) free(P) 165 #define omFreeFunc free 166 #define omFreeBinAddr(P) free(P) 167 #define omrealloc(A,NS) realloc(A,NS) 168 #define omreallocSize(A,OS,NS) realloc(A,NS) 181 169 #define omrealloc0Size(A,OS,NS) omRealloc0Size(A,OS,NS) 170 #define omRealloc(A,B) realloc(A,B) 171 #define omReallocAligned(A,B) realloc(A,B) 172 #define omReallocSize(A,B,C) realloc(A,C) 173 #define omReallocAlignedSize(A,B) realloc(A,B) 182 174 #define omMarkAsStaticAddr(A) 183 175 #define omGetSpecBin(A) (A) … … 190 182 #define omTypeReallocAlignedSize omTypeReallocSize 191 183 #define omTypeRealloc0AlignedSize omTypeRealloc0Size 192 #define omReallocAlignedSize omReallocSize193 184 #define omRealloc0AlignedSize omRealloc0Size 194 185 #define omMemDupAligned omMemDup … … 222 213 #undef OMALLOC_USES_MALLOC 223 214 #define X_OMALLOC 224 #define omMallocFunc omAlloc 225 #define omReallocSizeFunc omReallocSize 215 #define omMallocFunc malloc 226 216 #define omFreeSizeFunc omFreeSize 217 #define omReallocSizeFunc realloc 227 218 /* #define OM_NDEBUG */ 228 219 #undef OM_SING_KEEP
Note: See TracChangeset
for help on using the changeset viewer.