Branch: Tag:

2006-08-06

2006-08-06 16:58:07 by Martin Stjernholm <mast@lysator.liu.se>

Backported import of Doug Lea's malloc implementation. It's enabled by
default on Windows to fix bad fragmentation.

Rev: COPYRIGHT:1.15
Rev: lib/modules/Tools.pmod/Legal.pmod/Copyright.pmod:1.9
Rev: src/acconfig.h:1.144
Rev: src/configure.in:1.863
Rev: src/dmalloc.h:1.53
Rev: src/malloc.c:1.1
Rev: src/pike_memory.c:1.160

2:   || 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.52 2004/09/27 21:37:13 mast Exp $ + || $Id: dmalloc.h,v 1.53 2006/08/06 16:58:07 mast Exp $   */      #ifndef DMALLOC_H
136:      #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_close_fd(X) (X)
153:   #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)