Changeset 19553 for trunk/Nebulous/nebclient/src/xmalloc.c
- Timestamp:
- Sep 15, 2008, 11:24:30 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/nebclient/src/xmalloc.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/nebclient/src/xmalloc.c
r4677 r19553 4 4 * Copyright (C) 2003-2005 Joshua Hoblitt, 2003 Robert Lupton 5 5 * 6 * $Id: xmalloc.c,v 1. 3 2005-07-30 02:45:31jhoblitt Exp $6 * $Id: xmalloc.c,v 1.4 2008-09-15 21:24:30 jhoblitt Exp $ 7 7 */ 8 8 … … 11 11 #include "xmalloc.h" 12 12 13 //#define USE_EFF 1 14 #ifdef USE_EFF 15 #include "efence.h" 16 #endif 17 13 18 /*****************************************************************************/ 14 19 /* 15 20 * Wrappers for malloc/free. xmalloc cannot fail. 16 21 */ 17 void * xmalloc(size_t n) 22 void * x_xmalloc( 23 const char *file, 24 unsigned int lineno, 25 const char *func, 26 size_t n) 18 27 { 28 #ifdef USE_EFF 29 void *ptr = _eff_malloc(n, file, lineno); 30 #else 19 31 void *ptr = malloc(n); 32 #endif 20 33 21 34 if (ptr == NULL) { … … 27 40 } 28 41 29 void * xrealloc(void *ptr, size_t size) 42 void * x_xrealloc( 43 const char *file, 44 unsigned int lineno, 45 const char *func, 46 void *ptr, 47 size_t size) 30 48 { 49 #ifdef USE_EFF 50 void *newptr = _eff_realloc(ptr, size, file, lineno); 51 #else 31 52 void *newptr = realloc(ptr, size); 53 #endif 32 54 33 55 if (!newptr) { … … 39 61 } 40 62 41 void xfree(void *ptr) 63 void x_xfree( 64 const char *file, 65 unsigned int lineno, 66 const char *func, 67 void *ptr) 42 68 { 69 #ifdef USE_EFF 70 _eff_free(ptr, file, lineno); 71 #else 43 72 free(ptr); 73 #endif 44 74 }
Note:
See TracChangeset
for help on using the changeset viewer.
