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.59 2006/07/05 02:17:09 mast Exp $ + || $Id: dmalloc.h,v 1.60 2006/08/05 21:00:40 mast 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:60: Inside #if defined(DEBUG_MALLOC)
     extern int verbose_debug_malloc;   extern void dmalloc_trace(void *);   extern void dmalloc_register(void *, int, LOCATION);   extern int dmalloc_unregister(void *, int);   extern void *debug_malloc(size_t, LOCATION);   extern void *debug_calloc(size_t, size_t, LOCATION);   extern void *debug_realloc(void *, size_t, LOCATION);   extern void debug_free(void *, LOCATION, int);   extern char *debug_strdup(const char *, LOCATION); - extern void reset_debug_malloc(void); + void reset_debug_malloc(void);   int dmalloc_check_allocated (void *p, int must_be_freed);   #if 0   void dmalloc_check_block_free(void *, LOCATION, char *, describe_block_fn *);   #endif   extern void dmalloc_free(void *p);   extern int debug_malloc_touch_fd(int, LOCATION);   extern int debug_malloc_register_fd(int, LOCATION);   extern void debug_malloc_accept_leak_fd(int);   extern int debug_malloc_close_fd(int, LOCATION);   extern int dmalloc_mark_as_free(void*,int);
pike.git/src/dmalloc.h:139:    int offset,    int size,    int count,    struct memory_map *recur,    int recur_offset);   int dmalloc_is_invalid_memory_block(void *block);         #else /* DEBUG_MALLOC */    + #ifdef USE_DL_MALLOC + PMOD_EXPORT void* dlmalloc(size_t); + PMOD_EXPORT void dlfree(void*); + PMOD_EXPORT void* dlcalloc(size_t, size_t); + PMOD_EXPORT void* dlrealloc(void*, size_t); + PMOD_EXPORT void* dlmemalign(size_t, size_t); + PMOD_EXPORT void* dlvalloc(size_t); + PMOD_EXPORT void* dlpvalloc(size_t); + #define malloc dlmalloc + #define free dlfree + #define calloc dlcalloc + #define realloc dlrealloc + #define memalign dlmemalign + #define valloc dlvalloc + #define pvalloc dlpvalloc + #ifdef strdup + #undef strdup + #endif + #define strdup debug_xstrdup + #endif +    #define dmalloc_touch_fd(X) (X)   #define dmalloc_register_fd(X) (X)   #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    - #if defined(DYNAMIC_MODULE) && defined(__NT__) + #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 - #else /* defined(DYNAMIC_MODULE) && defined(__NT__) */ + #define xstrdup debug_xstrdup + #else   #define xmalloc malloc   #define xcalloc calloc   #define xrealloc realloc   #define xfree free - #endif /* !(defined(DYNAMIC_MODULE) && defined(__NT__)) */ + #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)   #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