1 /*------------------------------------------------------------------
2  * Wrapper for the ptmalloc2 memory manager.
3  *
4  * Compile the ptmalloc2 memory manager when MALLOC_ptmalloc is defined.
5  *
6  * ptmalloc2 was written by Wolfram Glober (www.malloc.de).
7  * ptmalloc2 is based on work of Doug Lea (gee.cs.oswego.edu).
8  * ptmalloc2 was adapted to ldmud by Christian Welzel (www.camlann.de)
9  *------------------------------------------------------------------
10  */
11 
12 #include "config.h"
13 #include "machine.h"
14 
15 #ifdef MALLOC_ptmalloc
16 
17 /* Define the configuration macros for ptmalloc */
18 
19 #if !defined(_GNU_SOURCE)
20 #    define _GNU_SOURCE 1
21 #endif
22 #define USE_TSD_DATA_HACK 1
23 #define _REENTRANT 1
24 #define USE_DL_PREFIX 1
25 #define USE_NO_SPINLOCKS 1
26 #define MALLOC_DEBUG 1
27 #define ENABLE_GC_SUPPORT 1
28 
29 #if defined(__APPLE__)
30 #    include <unistd.h>
31 #    define malloc_getpagesize getpagesize()
32 #endif
33 
34 #if !defined(HAS_PTHREAD_ATFORK)
35 #    define pthread_atfork(prepare,parent,child) do {} while(0)
36 #endif
37 
38 #include "ptmalloc/malloc.c"
39 
40 #endif /* MALLOC_ptmalloc */
41 
42 /***************************************************************************/
43