49#define st_alloc(size) st_mem_alloc((size), __FILE__, __LINE__)
56#define st_free(ptr) st_mem_free((ptr), __FILE__, __LINE__)
59#define ST__NEW(type, n, ...) ((type*)st_alloc(sizeof(type) * n))
71#define ST_NEW(...) ST__NEW(__VA_ARGS__, 1, )
void * st_mem_alloc(size_t size, const char *file, int line)
Allocate a contiguous memory region and optionally log a message on failure.
void st_mem_free(void *ptr, const char *file, int line)
Free a contiguous memory region and optionally log a message on failure.
void st_mem_cleanup(void)
If supported, free all the memory allocated with the system allocator.