clib_malloc
address.i1p.v = clib_malloc(num_bytes.u4.v)
This routine allocates dynamic memory. 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_bytes number of bytes of memory to allocate
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:
malloc, clib_free, clib_calloc, clib_realloc, clib_memory_block_length,
memory_diagnostic_control_c, memory_analyze
C/C++ usage:
char *address;
unsigned int num_bytes = 1000;
address = clib_malloc(num_bytes);