ref: 5acf222abf7bd65e3ccfe19b30fedd361d92cd7c
dir: /src/mem.h/
#if !defined(HEAP_SIZE0) #define HEAP_SIZE0 4*1024*1024 #endif #if !defined(STACK_SIZE0) #define STACK_SIZE0 64*1024 #endif #if !defined(ALLOC_LIMIT_TRIGGER) #define ALLOC_LIMIT_TRIGGER HEAP_SIZE0 #endif #if defined(USE_DLMALLOC) void *fl_malloc(size_t); void fl_free(void *); void *fl_calloc(size_t, size_t); void *fl_realloc(void *, size_t); char *fl_strdup(const char *s); #define MEM_CALLOC(n, sz) fl_calloc((size_t)(n), (size_t)(sz)) #define MEM_ALLOC(n) fl_malloc((size_t)(n)) #define MEM_REALLOC(p, n) fl_realloc((p), (size_t)(n)) #define MEM_FREE(x) fl_free(x) #define MEM_STRDUP(s) fl_strdup(s) #define fl_segalloc(sz) MEM_ALLOC((size_t)sz) #define fl_segfree(s, sz) MEM_FREE(s) #else #define MEM_CALLOC(n, sz) calloc((size_t)(n), (size_t)(sz)) #define MEM_ALLOC(n) malloc((size_t)(n)) #define MEM_REALLOC(p, n) realloc((p), (size_t)(n)) #define MEM_FREE(x) free(x) #define MEM_STRDUP(s) strdup(s) void *fl_segalloc(size_t sz); void fl_segfree(void *s, size_t sz); #endif