got rid of the WRAP_MALLOC code - mem_man does it better
authorAndrew Tridgell <tridge@samba.org>
Thu, 4 Dec 1997 07:49:37 +0000 (07:49 +0000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 4 Dec 1997 07:49:37 +0000 (07:49 +0000)
(This used to be commit d9bb3a4eba9c630370fea0fa297b176fd2afb532)

source3/lib/replace.c

index 67c18a15237b52e398ecb0076c96abc1682445cb..b27909db03495e4d39248138a1fc09181374d122 100644 (file)
@@ -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
 /*******************************************************************