20 return (
SELF){.name =
name, .base = alloc};
27 printf(
"%s allocated %zu bytes at %p\n", self->name,
size, ptr);
29 printf(
"%s failed to allocate %zu bytes\n", self->name,
size);
38 printf(
"%s allocated %zu bytes at %p\n", self->name, count *
size, ptr);
40 printf(
"%s failed to allocate %zu bytes\n", self->name, count *
size);
49 printf(
"%s reallocated memory at %p to %zu bytes\n", self->name, new_ptr,
size);
51 printf(
"%s failed to reallocate memory at %p to %zu bytes\n", self->name, ptr,
size);
58 printf(
"%s freeing memory at %p\n", self->name, ptr);
static void free(SELF *self, void *ptr)
static void * realloc(SELF *self, void *ptr, size_t size)
static void * malloc(SELF *self, size_t size)
static void * calloc(SELF *self, size_t count, size_t size)
#define DEBUG_ASSERT(expr)
static INDEX_TYPE size(SELF const *self)