7#if !defined(SKIP_INCLUDES)
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 debug(SELF const *self, dc_debug_fmt fmt, FILE *stream)
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 DC_TRAIT_ALLOC(SELF)
static INDEX_TYPE size(SELF const *self)
dc_debug_fmt dc_debug_fmt_scope_end(dc_debug_fmt fmt)
dc_debug_fmt dc_debug_fmt_scope_begin(dc_debug_fmt fmt)
static void dc_debug_fmt_print(dc_debug_fmt fmt, FILE *stream, const char *format,...)
#define DC_ASSUME(expr,...)
Debug format helpers for debug printin data structures.
static FILE * stream(SELF *self)
Opens a file for.