added optonal MEM_MAN code
authorAndrew Tridgell <tridge@samba.org>
Thu, 4 Dec 1997 07:48:06 +0000 (07:48 +0000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 4 Dec 1997 07:48:06 +0000 (07:48 +0000)
source/include/includes.h
source/include/proto.h

index 5bfe02414532084a2967fd4bc9b2d711a41df2ec..6c2b676b3128c44a14588f56264cd33c44f74eaf 100644 (file)
@@ -1285,51 +1285,8 @@ extern int errno;
 #define strcpy(dest,src) StrCpy(dest,src)
 #endif
 
-
-/* possibly wrap the malloc calls */
-#if WRAP_MALLOC
-
-/* undo the old malloc def if necessary */
-#ifdef malloc
-#define xx_old_malloc malloc
-#undef malloc
-#endif
-
-#define malloc(size) malloc_wrapped(size,__FILE__,__LINE__)
-
-/* undo the old realloc def if necessary */
-#ifdef realloc
-#define xx_old_realloc realloc
-#undef realloc
-#endif
-
-#define realloc(ptr,size) realloc_wrapped(ptr,size,__FILE__,__LINE__)
-
-/* undo the old free def if necessary */
-#ifdef free
-#define xx_old_free free
-#undef free
-#endif
-
-#define free(ptr) free_wrapped(ptr,__FILE__,__LINE__)
-
-/* and the malloc prototypes */
-void *malloc_wrapped(int,char *,int);
-void *realloc_wrapped(void *,int,char *,int);
-void free_wrapped(void *,char *,int);
-
-#endif
-
-
-#if WRAP_MEMCPY
-/* undo the old memcpy def if necessary */
-#ifdef memcpy
-#define xx_old_memcpy memcpy
-#undef memcpy
-#endif
-
-#define memcpy(d,s,l) memcpy_wrapped(d,s,l,__FILE__,__LINE__)
-void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
+#if MEM_MAN
+#include "mem_man/mem_man.h"
 #endif
 
 #endif
index 64d9d7a3fca9a95595e3a3b7a57b9ce3ffa88616..ca37799bd72e3613b4758395712e14446006ecef 100644 (file)
@@ -429,6 +429,21 @@ BOOL name_map_mangle(char *OutName,BOOL need83,int snum);
 
 void mdfour(unsigned char *out, unsigned char *in, int n);
 
+/*The following definitions come from  mem_man/mem_man.c  */
+
+void *mem_malloc(size_t size,char *file,int line);
+char *mem_strdup(char *s, char *file, int line);
+int mem_free(void *ptr,char *file,int line);
+void mem_write_info(void *ptr,FILE *outfile);
+char *mem_query_file(void *ptr);
+int mem_query_line(void *ptr);
+int mem_test(void *ptr);
+void mem_write_status(FILE *outfile);
+void mem_write_verbose(FILE *outfile);
+void mem_write_errors(FILE *outfile);
+void mem_set_multiplier(int multiplier);
+void *mem_resize(void *ptr,size_t newsize);
+
 /*The following definitions come from  message.c  */
 
 int reply_sends(char *inbuf,char *outbuf);
@@ -711,6 +726,11 @@ int read_predict(int fd,int offset,char *buf,char **ptr,int num);
 void do_read_prediction();
 void invalidate_read_prediction(int fd);
 
+/*The following definitions come from  print_svid.c  */
+
+void sysv_printer_fn(void (*fn)());
+int sysv_printername_ok(char *name);
+
 /*The following definitions come from  printing.c  */
 
 void lpq_reset(int snum);