diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-12-04 07:49:37 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-12-04 07:49:37 +0000 |
commit | c81a3b8a56584da5d272e5b4f7572c723f801285 (patch) | |
tree | 9a3f55966705038eec6e4b610967cae886c06a6c /source3 | |
parent | 500069329a878cdf2173e24cf2419991ee6ce323 (diff) | |
download | samba-c81a3b8a56584da5d272e5b4f7572c723f801285.tar.gz samba-c81a3b8a56584da5d272e5b4f7572c723f801285.tar.bz2 samba-c81a3b8a56584da5d272e5b4f7572c723f801285.zip |
got rid of the WRAP_MALLOC code - mem_man does it better
(This used to be commit d9bb3a4eba9c630370fea0fa297b176fd2afb532)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/replace.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/source3/lib/replace.c b/source3/lib/replace.c index 67c18a1523..b27909db03 100644 --- a/source3/lib/replace.c +++ b/source3/lib/replace.c @@ -238,73 +238,6 @@ long nap(long milliseconds) { #endif - -#if WRAP_MALLOC - -/* undo the wrapping temporarily */ -#undef malloc -#undef realloc -#undef free - -/**************************************************************************** -wrapper for malloc() to catch memory errors -****************************************************************************/ -void *malloc_wrapped(int size,char *file,int line) -{ -#ifdef xx_old_malloc - void *res = xx_old_malloc(size); -#else - void *res = malloc(size); -#endif - DEBUG(3,("Malloc called from %s(%d) with size=%d gave ptr=0x%X\n", - file,line, - size,(unsigned int)res)); - return(res); -} - -/**************************************************************************** -wrapper for realloc() to catch memory errors -****************************************************************************/ -void *realloc_wrapped(void *ptr,int size,char *file,int line) -{ -#ifdef xx_old_realloc - void *res = xx_old_realloc(ptr,size); -#else - void *res = realloc(ptr,size); -#endif - DEBUG(3,("Realloc\n")); - DEBUG(3,("free called from %s(%d) with ptr=0x%X\n", - file,line, - (unsigned int)ptr)); - DEBUG(3,("Malloc called from %s(%d) with size=%d gave ptr=0x%X\n", - file,line, - size,(unsigned int)res)); - return(res); -} - -/**************************************************************************** -wrapper for free() to catch memory errors -****************************************************************************/ -void free_wrapped(void *ptr,char *file,int line) -{ -#ifdef xx_old_free - xx_old_free(ptr); -#else - free(ptr); -#endif - DEBUG(3,("free called from %s(%d) with ptr=0x%X\n", - file,line,(unsigned int)ptr)); - return; -} - -/* and re-do the define for spots lower in this file */ -#define malloc(size) malloc_wrapped(size,__FILE__,__LINE__) -#define realloc(ptr,size) realloc_wrapped(ptr,size,__FILE__,__LINE__) -#define free(ptr) free_wrapped(ptr,__FILE__,__LINE__) - -#endif - - #if WRAP_MEMCPY #undef memcpy /******************************************************************* |