pike.git / src / dmalloc.h

version» Context lines:

pike.git/src/dmalloc.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: dmalloc.h,v 1.68 2008/09/04 20:31:07 mast Exp $ + || $Id: dmalloc.h,v 1.69 2010/07/01 13:40:58 grubba Exp $   */      #ifndef DMALLOC_H   #define DMALLOC_H      PMOD_EXPORT extern void *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);
pike.git/src/dmalloc.h:134:   #define debug_malloc_pass(X) debug_malloc_update_location((void *)(X),DMALLOC_LOCATION())   #define debug_malloc_pass_named(X,NAME) debug_malloc_update_location((void *)(X),DMALLOC_NAMED_LOCATION(" " NAME))   #define dmalloc_touch_struct_ptr(TYPE,X,MEMBER) ((TYPE)debug_malloc_update_location_ptr((void *)(X), ((ptrdiff_t)& (((TYPE)0)->MEMBER)), DMALLOC_LOCATION()))      /* These also save the call stack if support for that exists. Beware    * that this can take a lot of extra memory - for temporary use only. */   #define debug_malloc_touch_bt(X) debug_malloc_update_location_bt ((void *)(X), __FILE__, __LINE__, NULL)   #define debug_malloc_touch_named_bt(X,NAME) debug_malloc_update_location_bt ((void *)(X), __FILE__, __LINE__, (NAME))      #define xalloc(X) ((void *)debug_malloc_update_location((void *)debug_xalloc(X), DMALLOC_NAMED_LOCATION(" xalloc"))) + #define xcalloc(N, S) ((void *)debug_malloc_update_location((void *)debug_xcalloc(N, S), DMALLOC_NAMED_LOCATION(" xcalloc")))   #define xfree(X) debug_xfree(debug_malloc_update_location((X), DMALLOC_NAMED_LOCATION(" free")))   PMOD_EXPORT void debug_malloc_dump_references(void *x, int indent, int depth, int flags);   #define dmalloc_touch(TYPE,X) ((TYPE) debug_malloc_pass (X))   #define dmalloc_touch_named(TYPE,X,NAME) ((TYPE) debug_malloc_pass_named (X, NAME))   void debug_malloc_dump_fd(int fd); - #define dmalloc_touch_svalue(X) do { struct svalue *_tmp = (X); if (_tmp->type <= MAX_REF_TYPE) { debug_malloc_touch(_tmp->u.refs); } } while(0) - #define dmalloc_touch_svalue_named(X,NAME) do { struct svalue *_tmp = (X); if (_tmp->type <= MAX_REF_TYPE) { debug_malloc_touch_named(_tmp->u.refs,NAME); } } while(0) + #define dmalloc_touch_svalue(X) do { const struct svalue *_tmp = (X); if (_tmp->type <= MAX_REF_TYPE) { debug_malloc_touch(_tmp->u.refs); } } while(0) + #define dmalloc_touch_svalue_named(X,NAME) do { const struct svalue *_tmp = (X); if (_tmp->type <= MAX_REF_TYPE) { debug_malloc_touch_named(_tmp->u.refs,NAME); } } while(0)      #define DMALLOC_LINE_ARGS ,char * dmalloc_location   #define DMALLOC_POS ,DMALLOC_LOCATION()   #define DMALLOC_PROXY_ARGS ,dmalloc_location   PMOD_EXPORT void dmalloc_accept_leak(void *);   #define dmalloc_touch_fd(X) debug_malloc_touch_fd((X),DMALLOC_LOCATION())   #define dmalloc_register_fd(X) debug_malloc_register_fd((X),DMALLOC_LOCATION())   #define dmalloc_accept_leak_fd(X) debug_malloc_accept_leak_fd(X)   #define dmalloc_close_fd(X) debug_malloc_close_fd((X),DMALLOC_LOCATION())   
pike.git/src/dmalloc.h:203:   #define dmalloc_accept_leak_fd(X)   #define dmalloc_close_fd(X) (X)   #define dmfree(X) free((X))   #define dmalloc_accept_leak(X) (void)(X)   #define DMALLOC_LINE_ARGS   #define DMALLOC_POS   #define DMALLOC_PROXY_ARGS   #define debug_malloc_dump_references(X,x,y,z)   #define debug_malloc_dump_fd(fd)   #define xalloc debug_xalloc + #define xcalloc debug_xcalloc      #if defined(DYNAMIC_MODULE) && defined(__NT__) && !defined(USE_DLL)   #define xmalloc debug_xmalloc - #define xcalloc debug_xcalloc +    #define xrealloc debug_xrealloc   #define xfree debug_xfree   #define xstrdup debug_xstrdup   #else   #define xmalloc malloc - #define xcalloc calloc +    #define xrealloc realloc   #define xfree free   #define xstrdup strdup   #endif      #define dbm_main main   #define DO_IF_DMALLOC(X)   #define DO_IF_NOT_DMALLOC(X) X   #define dmalloc_trace(X)   #define dmalloc_register(X,Y,Z)