#if !defined(HEAP_SIZE0) // NOTE: has to be at least enough to start with no gc calls #define HEAP_SIZE0 (usize)4*1024*1024 #endif #if !defined(STACK_SIZE0) #define STACK_SIZE0 (usize)4*1024 #endif #if !defined(ALLOC_LIMIT_TRIGGER) #define ALLOC_LIMIT_TRIGGER HEAP_SIZE0 #endif #if !defined(MEM_CALLOC) #define MEM_CALLOC(n, sz) calloc((usize)(n), (usize)(sz)) #define MEM_ALLOC(n) malloc((usize)(n)) #define MEM_REALLOC(p, n) realloc((p), (usize)(n)) #define MEM_FREE(x) free(x) #define MEM_STRDUP(s) strdup(s) #if !defined(sl_segalloc) void *sl_segalloc(usize sz); void sl_segfree(void *s, usize sz); void sl_segused(void *s, usize sz, usize used) sl_nonnull(1); #endif #endif