106 (void) which; (void) iteration; (void) context;
135 size_t gross = n*size;
139 o = calloc (n, size);
156 o = realloc (ptr, size);
172 o = strndup (str, len);
186 return a == b ? 0 : strncmp (a?a:
"", b?b:
"", len);
Portable and safe wrappers around some C-Lib functions.
void * lumiera_calloc(size_t n, size_t size)
Allocate cleared memory for an array.
lumiera_resource_try
Iteration indicator.
No op, returned by a handler when it did nothing.
static int die_no_mem(enum lumiera_resource which, enum lumiera_resource_try *iteration, void *context)
Lumiera error handling (C interface).
try to free a bigger implementation defined amount of resources
int lumiera_strncmp(const char *a, const char *b, size_t len)
Compare two C strings.
try to free one or really few of this resources
int lumiera_streq(const char *a, const char *b)
check 2 strings for identity.
void * lumiera_realloc(void *ptr, size_t size)
Change the size of a memory block.
#define LUMIERA_DIE(err)
Abort unconditionally with a 'Fatal Error!' message.
void * lumiera_malloc(size_t size)
Allocate memory.
try to free a small reasonable implementation defined amount of resources
When a handler gets unregistered it will be called with this value to give it a chance to clean up th...
char * lumiera_strndup(const char *str, size_t len)
Duplicate a C string.
lumiera_resource
Resources known to the resource collector.
memory blocks, context is a pointer to the size_t required
#define LUMIERA_ERROR_DEFINE(err, msg)
Definition and initialisation of an error constant.