1 #if (defined(NOMEMMAN) && !defined(MEM_MAN_MAIN) && defined(HAVE_MALLOC_H))
5 /* user settable parameters */
10 this is the maximum number of blocks that can be allocated at one
11 time. Set this to more than the max number of mallocs you want possible
13 #define MEM_MAX_MEM_OBJECTS 20000
16 maximum length of a file name. This is for the source files only. This
17 would normally be around 30 - increase it only if necessary
19 #define MEM_FILE_STR_LENGTH 30
22 default mem multiplier. All memory requests will be multiplied by
23 this number, thus allowing fast resizing. High values chew lots of
24 memory but allow for easy resizing
26 #define MEM_DEFAULT_MEM_MULTIPLIER 1
29 the length of the corruption buffers before and after each memory block.
30 Using these can reduce memory overrun errors and catch bad code. The
31 amount actually allocated is this times 2 times sizeof(char)
33 #define MEM_CORRUPT_BUFFER 16
36 the 'seed' to use for the corruption buffer. zero is a very bad choice
38 #define MEM_CORRUPT_SEED 0x10
42 seed increment. This is another precaution. This will be added to the
43 'seed' for each adjacent element of the corruption buffer
45 #define MEM_SEED_INCREMENT 0x1
49 memory fill. This will be copied over all allocated memory - to aid in
50 debugging memory dumps. It is one byte long
52 #define MEM_FILL_BYTE 42
56 this determines whether free() on your system returns an integer or
57 nothing. If unsure then leave this un defined.
59 /* #define MEM_FREE_RETURNS_INT */
63 This determines whether a signal handler will be instelled to do
64 a mem_write_verbose on request
66 #define MEM_SIGNAL_HANDLER
70 This sets which vector to use if MEM_SIGNAL_HANDLER is defined
72 #define MEM_SIGNAL_VECTOR SIGUSR1
78 #define malloc(x) smb_mem_malloc(x,__FILE__,__LINE__)
79 #define free(x) smb_mem_free(x,__FILE__,__LINE__)
80 #define realloc(ptr,newsize) smb_mem_resize(ptr,newsize)
84 #define calloc(nitems,size) malloc(((_mem_size)nitems)*((_mem_size)size))
89 #define strdup(s) smb_mem_strdup(s, __FILE__, __LINE__)