14static nullalloc
NS(nullalloc,
get)() {
return (nullalloc){}; }
22static void*
NS(nullalloc,
realloc)(nullalloc* self,
void* ptr,
size_t size) {
29static void*
NS(nullalloc,
calloc)(nullalloc* self,
size_t count,
size_t size) {
36static void NS(nullalloc,
free)(nullalloc* self,
void* ptr) {
39 DC_PANIC(
"Not possible to free memory from the null allocator, as it allocates nothing")
44 fprintf(
stream,
"nullalloc@%p { }", self);
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)
#define DC_ASSUME(expr,...)
Debug format helpers for debug printin data structures.
static FILE * stream(SELF *self)
Opens a file for.
#define DC_ZERO_SIZED(TYPE)
Zero sized types are useful as markers (e.g. for gdb printing, or to replace debug info structs.