clib_calloc
address.i1p.v = clib_calloc(num_items.u4.v, item_size.u4.v)
This routine allocates an area of dynamic memory and initializes all
bytes in it to zero. Any errors that occur will be written to the
standard output device if the memory diagnostic mode is entered by
using the debugger. (Note: This routine can be included in source
code transparently by including the header file 'memory_macro'.)
num_items number of items to allocate memory for
item_size size of each item in bytes
This function returns values as follows:
NULL memory allocation failed
otherwise address of allocated memory
This function requires the following include files:
cnsparam_h, clib_memory_h, memory_macro_h
Related functions:
calloc, clib_free, clib_malloc, clib_realloc, clib_memory_block_length,
memory_diagnostic_control_c, memory_analyze
C/C++ usage:
char *address;
unsigned int num_items = 2;
unsigned int item_size = sizeof(int);
address = clib_calloc(num_items,item_size);