Branch: Tag:

1999-05-02

1999-05-02 08:13:05 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

more debug and fixed a memory leak in interpret.c

Rev: src/backend.c:1.41
Rev: src/backend.h:1.7
Rev: src/block_alloc.h:1.11
Rev: src/block_alloc_h.h:1.4
Rev: src/builtin_functions.c:1.168
Rev: src/callback.c:1.17
Rev: src/callback.h:1.8
Rev: src/configure.in:1.281
Rev: src/constants.c:1.18
Rev: src/dmalloc.h:1.11
Rev: src/error.c:1.35
Rev: src/error.h:1.36
Rev: src/gc.c:1.42
Rev: src/gc.h:1.22
Rev: src/interpret.c:1.122
Rev: src/interpret.h:1.31
Rev: src/interpreter.h:1.5
Rev: src/modules/call_out/call_out.c:1.27
Rev: src/modules/files/file.c:1.152
Rev: src/modules/system/system.c:1.70
Rev: src/pike_memory.c:1.37
Rev: src/program.c:1.123
Rev: src/signal_handler.c:1.129
Rev: src/stralloc.c:1.59
Rev: src/threads.c:1.93

1:   /* -  * $Id: dmalloc.h,v 1.10 1999/03/19 11:39:29 hubbe Exp $ +  * $Id: dmalloc.h,v 1.11 1999/05/02 08:11:38 hubbe Exp $    */      extern char *debug_xalloc(long);
16: Inside #if defined(DEBUG_MALLOC)
     extern int verbose_debug_malloc;   extern int verbose_debug_exit; + extern void dmalloc_register(void *, int,char *, int); + extern int dmalloc_unregister(void *, int);   extern void *debug_malloc(size_t, const char *, int);   extern void *debug_calloc(size_t, size_t, const char *, int);   extern void *debug_realloc(void *, size_t, const char *, int); - extern void debug_free(void *, const char *, int); + extern void debug_free(void *, const char *, int,int);   extern char *debug_strdup(const char *, const char *, int);   extern void reset_debug_malloc(void); -  + extern void dmalloc_free(void *p);   void *debug_malloc_update_location(void *,const char *, int);   #define malloc(x) debug_malloc((x), __FILE__, __LINE__)   #define calloc(x, y) debug_calloc((x), (y), __FILE__, __LINE__)   #define realloc(x, y) debug_realloc((x), (y), __FILE__, __LINE__) - #define free(x) debug_free((x), __FILE__, __LINE__) + #define free(x) debug_free((x), __FILE__, __LINE__,0) + #define dmfree(x) debug_free((x),__FILE__,__LINE__,1)   #define strdup(x) debug_strdup((x), __FILE__, __LINE__)   #define DO_IF_DMALLOC(X) X   #define debug_malloc_touch(X) debug_malloc_update_location((X),__FILE__,__LINE__)
34:   #define xalloc(X) ((char *)debug_malloc_touch(debug_xalloc(X)))   void debug_malloc_dump_references(void *x);   #define dmalloc_touch(TYPE,X) ((TYPE)debug_malloc_update_location((X),__FILE__,__LINE__)) +  + #define DMALLOC_LINE_ARGS ,char * dmalloc_file, int dmalloc_line + #define DMALLOC_POS ,__FILE__,__LINE__ + #define DMALLOC_PROXY_ARGS ,dmalloc_file,dmalloc_line + void *dmalloc_accept_leak(void *);   #else -  + #define dmfree(X) free((X)) + #define dmalloc_accept_leak(X) (X) + #define DMALLOC_LINE_ARGS + #define DMALLOC_POS + #define DMALLOC_PROXY_ARGS   #define debug_malloc_dump_references(X)   #define xalloc debug_xalloc   #define dbm_main main
43:   #define debug_malloc_touch(X)   #define debug_malloc_pass(X) (X)   #define dmalloc_touch(TYPE,X) (X) + #define dmalloc_register(X,Y,Z) + #define dmalloc_unregister(X,Y) + #define debug_free(X,Y,Z,Q) free((X))   #endif