From c81a3b8a56584da5d272e5b4f7572c723f801285 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 4 Dec 1997 07:49:37 +0000 Subject: got rid of the WRAP_MALLOC code - mem_man does it better (This used to be commit d9bb3a4eba9c630370fea0fa297b176fd2afb532) --- source3/lib/replace.c | 67 --------------------------------------------------- 1 file changed, 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 /******************************************************************* -- cgit