8 #define ALLOC_ENOTALLOC -3
9 #define ALLOC_EMISMATCH -2
10 #define ALLOC_ENOMEMORY -1
12 #define ALLOC_DIR_TOP -1
13 #define ALLOC_DIR_BOT +1
14 #define ALLOC_DIR_BOTH 0
65 #define allocator_alloc_bot(alloc, name, size) \
66 allocator_alloc(alloc, name, size, ALLOC_DIR_BOT, "%s:%d", __FILE__, __LINE__)
68 #define allocator_alloc_top(alloc, name, size) \
69 allocator_alloc(alloc, name, size, ALLOC_DIR_TOP, "%s:%d", __FILE__, __LINE__)
71 #define allocator_realloc(alloc, ptr, size) \
72 allocator_realloc_int(alloc, ptr, size, "%s:%d", __FILE__, __LINE__)
int allocator_iter_next(AllocatorIter *iter)
int allocator_init(Allocator *alloc, const char *name, const size_t size, const int zero, Allocator *parent)
void allocator_free(void *ptr)
int allocator_split(Allocator *alloc, Allocator *parent, const char *name, const size_t request_size, const int zero)
int allocator_reset(Allocator *alloc, int zero)
size_t allocator_get_free_size(Allocator *alloc)
int allocator_dealloc(Allocator *alloc, void *ptr)
void * allocator_realloc_int(Allocator *alloc, void *ptr, const size_t size, const char *fmt,...)
void allocator_print(Allocator *alloc)
int allocator_iter_start(AllocatorIter *iter, Allocator *alloc)
int allocator_malloc_init(Allocator *alloc, const char *name, const size_t size, const int zero, Allocator *parent)
int allocator_destroy(Allocator *alloc)
size_t allocator_get_used_size(Allocator *alloc, int dir)
void * allocator_alloc(Allocator *alloc, const char *name, const size_t size, const int dir, const char *fmt,...)
int allocator_iter_ended(AllocatorIter *iter)