pike.git / src / dmalloc.h

version» Context lines:

pike.git/src/dmalloc.h:1:   /* -  * $Id: dmalloc.h,v 1.30 2001/02/28 04:25:30 hubbe Exp $ +  * $Id: dmalloc.h,v 1.31 2001/06/28 10:24:21 hubbe Exp $    */      PMOD_EXPORT extern char *debug_xalloc(size_t);   PMOD_EXPORT extern void debug_xfree(void *);   PMOD_EXPORT extern void *debug_xmalloc(size_t);   PMOD_EXPORT extern void *debug_xcalloc(size_t,size_t);   PMOD_EXPORT extern void *debug_xrealloc(void *,size_t);      #define DMALLOC_LOCATION() (("NS" __FILE__ ":" DEFINETOSTR(__LINE__) )+1)   
pike.git/src/dmalloc.h:39: Inside #if defined(DEBUG_MALLOC)
  extern void *debug_realloc(void *, size_t, char *);   extern void debug_free(void *, char *,int);   extern char *debug_strdup(const char *, char *);   extern void reset_debug_malloc(void);   extern void dmalloc_free(void *p);   extern int debug_malloc_touch_fd(int, char *);   extern int debug_malloc_register_fd(int, char *);   extern int debug_malloc_close_fd(int, char *);      void *debug_malloc_update_location(void *, char *); + void *debug_malloc_update_location_ptr(void *, ptrdiff_t, char *);   void search_all_memheaders_for_references(void);      /* Beware! names of named memory regions are never ever freed!! /Hubbe */   void *debug_malloc_name(void *p, char *fn, int line);   int debug_malloc_copy_names(void *p, void *p2);   char *dmalloc_find_name(void *p);      /* glibc 2.1 defines this as a macro. */   #ifdef strdup   #undef strdup
pike.git/src/dmalloc.h:60:      #define malloc(x) debug_malloc((x), DMALLOC_LOCATION())   #define calloc(x, y) debug_calloc((x), (y), DMALLOC_LOCATION())   #define realloc(x, y) debug_realloc((x), (y), DMALLOC_LOCATION())   #define free(x) debug_free((x), DMALLOC_LOCATION(),0)   #define dmfree(x) debug_free((x),DMALLOC_LOCATION(),1)   #define strdup(x) debug_strdup((x), DMALLOC_LOCATION())   #define DO_IF_DMALLOC(X) X   #define debug_malloc_touch(X) debug_malloc_update_location((X),DMALLOC_LOCATION())   #define debug_malloc_pass(X) debug_malloc_update_location((X),DMALLOC_LOCATION()) + #define dmalloc_touch_struct_ptr(TYPE,X,MEMBER) ((TYPE)debug_malloc_update_location_ptr((X), ((ptrdiff_t)& (((TYPE)0)->MEMBER)), DMALLOC_LOCATION())) +    #define xalloc(X) ((char *)debug_malloc_pass(debug_xalloc(X)))   #define xfree(X) debug_xfree(debug_malloc_pass((X)))   void debug_malloc_dump_references(void *x, int indent, int depth, int flags);   #define dmalloc_touch(TYPE,X) ((TYPE)debug_malloc_update_location((X),DMALLOC_LOCATION()))   #define dmalloc_touch_svalue(X) do { struct svalue *_tmp = (X); if ((X)->type <= MAX_REF_TYPE) { debug_malloc_touch(_tmp->u.refs); } } while(0)      #define DMALLOC_LINE_ARGS ,char * dmalloc_location   #define DMALLOC_POS ,DMALLOC_LOCATION()   #define DMALLOC_PROXY_ARGS ,dmalloc_location   void dmalloc_accept_leak(void *);
pike.git/src/dmalloc.h:122:   #endif   #define dbm_main main   #define DO_IF_DMALLOC(X)   #define dmalloc_register(X,Y,Z)   #define dmalloc_unregister(X,Y)   #define debug_free(X,Y,Z) free((X))   #define debug_malloc_name(P,FN,LINE)   #define debug_malloc_copy_names(p,p2) 0   #define search_all_memheaders_for_references()   #define dmalloc_find_name(X) "unknown (no dmalloc)" + #define dmalloc_touch_struct_ptr(TYPE,X,MEMBER) (X)      #ifdef DMALLOC_TRACE   #define debug_malloc_update_location(X,Y) (DMALLOC_TRACE_LOG(DMALLOC_LOCATION()),(X))   #define dmalloc_touch_svalue(X) DMALLOC_TRACE_LOG(DMALLOC_LOCATION())   #define debug_malloc_touch(X) DMALLOC_TRACE_LOG(DMALLOC_LOCATION())   #define debug_malloc_pass(X) (DMALLOC_TRACE_LOG(DMALLOC_LOCATION()),(X))   #define dmalloc_touch(TYPE,X) (DMALLOC_TRACE_LOG(DMALLOC_LOCATION()),(X))   #else   #define debug_malloc_update_location(X,Y) (X)   #define dmalloc_touch_svalue(X)   #define debug_malloc_touch(X)   #define debug_malloc_pass(X) (X)   #define dmalloc_touch(TYPE,X) (X)   #endif      #endif