next up previous contents index
Next: 9.5.4 memalign: allocate aligned Up: 9.5 Memory Allocation Previous: 9.5.2 malloc: allocate uninitialized

9.5.3 mustmalloc: allocate uninitialized memory and panic on failure

   

SYNOPSIS

#include <oskit/c/malloc.h>

void *mustmalloc(size_t size);

DESCRIPTION

Calls malloc to allocate memory, asserting that the return is non-zero; i.e., mustmalloc will panic if no memory is available.

Note that if NDEBUG is defined, assert will do nothing and this routine is identical to malloc.

PARAMETERS

size
Size in bytes of desired allocation.

RETURNS

Returns a pointer to the allocated memory if it returns at all.



University of Utah Flux Research Group