Changeset 2798
- Timestamp:
- Sep 19, 2015, 10:35:03 PM (10 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/kmk/electric.c ¶
r2626 r2798 31 31 # include <sys/mman.h> 32 32 # include <errno.h> 33 # include <stdint.h> 33 34 # endif 34 35 # include <string.h> … … 157 158 # endif 158 159 } 160 159 161 160 162 void * … … 193 195 } 194 196 197 # ifdef __GNUC__ 198 void * 199 xmalloc_size_t (size_t size) 200 { 201 return xmalloc(size); 202 } 203 204 void * 205 xcalloc_size_t (size_t size, size_t items) 206 { 207 return xcalloc(size * items); 208 } 209 210 void * 211 xrealloc_size_t (void *ptr, size_t size) 212 { 213 return xrealloc(ptr, size); 214 } 215 # endif /* __GNUC__ */ 216 195 217 #else /* !ELECTRIC_HEAP */ 196 218 extern void electric_heap_keep_ansi_c_quiet (void); -
TabularUnified trunk/src/kmk/electric.h ¶
r2591 r2798 37 37 void *xrealloc (void *, unsigned int); 38 38 char *xstrdup (const char *); 39 #ifdef __GNUC__ 40 void *xmalloc_size_t (size_t size); 41 void *xcalloc_size_t (size_t size, size_t items); 42 void *xrealloc_size_t (void *ptr, size_t size); 43 #endif 39 44 45 46 #undef free 40 47 #define free(a) xfree(a) 41 #define calloc(a,b) xcalloc((a) * (b)) 42 #define malloc(a) xmalloc(a) 43 #define realloc(a,b) xrealloc((a),(b)) 48 #undef strdup 44 49 #define strdup(a) xstrdup(a) 50 51 #undef calloc 52 #undef malloc 53 #undef realloc 54 #ifdef __GNUC__ 55 # define calloc(a,b) xcalloc_size_t(a,b) 56 # define malloc(a) xmalloc_size_t(a) 57 # define realloc(a,b) xrealloc_size_t(a,b) 58 #else 59 # define calloc(a,b) xcalloc((a) * (b)) 60 # define malloc(a) xmalloc(a) 61 # define realloc(a,b) xrealloc((a),(b)) 62 #endif 45 63 46 64 #endif
Note:
See TracChangeset
for help on using the changeset viewer.