7 /* allocate a chunk of stack memory, uninitialized */
8 #define mhl_mem_alloc_u(sz) (malloc(sz))
10 /* allocate a chunk of stack memory, zeroed */
11 #define mhl_mem_alloc_z(sz) (calloc(1,sz))
13 /* free a chunk of memory from stack, passing NULL does no harm */
14 static inline void mhl_mem_free(void* ptr
)
19 /* free an ptr and NULL it */
20 #define MHL_PTR_FREE(ptr) do { mhl_mem_free(ptr); (ptr) = NULL; } while (0);
22 /* allocate a chunk on stack - automatically free'd on function exit */
23 #define mhl_stack_alloc(sz) (alloca(sz))
25 /* re-alloc memory chunk */
26 #define mhl_mem_realloc(ptr,sz) (realloc(ptr,sz))