The header file for the memory management library is as follows:
Defines the memory allocation/deallocation function.
By setting an exception handling function address to the _ec2p_new_handler variable, exception handling can be executed if memory allocation fails. The _ec2p_new_handler is a static variable and the initial value is NULL. If this handler is used, reentrance will be lost.
Operations required for the exception handling function:
Allocates a memory area with the size specified by size.
If memory allocation fails and when new_handler is set, new_handler is called.
Return value: If memory allocation succeeds: Pointer to void type
If memory allocation fails: NULL
Allocates an array area with the size specified by size.
If memory allocation fails and when new_handler is set, new_handler is called.
Return value: If memory allocation succeeds: Pointer to void type
If memory allocation fails: NULL
Allocates the area specified by ptr as the storage area.
Allocates the area specified by ptr as the array area.
Deallocates the storage area specified by ptr.
If ptr is NULL, no operation will be performed.
Deallocates the array area specified by ptr.
If ptr is NULL, no operation will be performed.
Sets new_P to _ec2p_new_handler.