22 return (
SELF){.name =
name, .base = alloc};
29 printf(
"%s allocated %zu bytes at %p\n", self->name,
size, ptr);
31 printf(
"%s failed to allocate %zu bytes\n", self->name,
size);
40 printf(
"%s allocated %zu bytes at %p\n", self->name, count *
size, ptr);
42 printf(
"%s failed to allocate %zu bytes\n", self->name, count *
size);
51 printf(
"%s reallocated memory at %p to %zu bytes\n", self->name, new_ptr,
size);
53 printf(
"%s failed to reallocate memory at %p to %zu bytes\n", self->name, ptr,
size);
60 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 TRAIT_ALLOC(SELF)
static INDEX_TYPE size(SELF const *self)