next up previous contents index
Next: 9.5.7 realloc: change the Up: 9.5 Memory Allocation Previous: 9.5.5 calloc: allocate cleared

9.5.6 mustcalloc: allocate cleared memory and panic on failure

   

SYNOPSIS

#include <oskit/c/malloc.h>

void *mustcalloc(size_t nelt, size_t eltsize);

DESCRIPTION

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

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

PARAMETERS

nelt
Number of elements being allocated.
eltsize
Size of each element.

RETURNS

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



University of Utah Flux Research Group