English
Language : 

CC78K4 Datasheet, PDF (201/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 10 LIBRARY FUNCTIONS
5-5 malloc
Utility Functions
FUNCTION
The memory function malloc allocates a block of memory.
HEADER
stdlib. h
FUNCTION PROTOTYPE
void *malloc (size_t size);
Function
malloc
Arguments
size ... Size of memory block
to be allocated
Return Value
• Pointer to the beginning of
the allocated area if the
requested size is allocated
• Null pointer if the requested
size is not allocated
EXPLANATION
• The malloc function allocates a block of memory for the number of bytes specified by size and returns a
pointer to the first byte of the allocated area.
• If memory cannot be allocated, the function returns a null pointer. (This memory allocation will start from a
break value and the address next to the allocated area will become a new break value. See 5-11 brk for
break value setting with the memory function brk.)
User’s Manual U15556EJ1V0UM
201