Everything

realloc


Changes the size of a storage area to a specified value.

[Format]

#include <stdlib.h>

void *realloc (void *ptr, size_t size);

[Parameters]

ptr Starting address of storage area to be changed

size Size of storage area in number of bytes after the change

[Return values]

Normal: Starting address of storage area whose size has been changed

Abnormal: Storage area allocation has failed, or size is 0: NULL

[Remarks]

The realloc function changes the size of the storage area specified by ptr to the number of bytes specified by size. If the newly allocated storage area is smaller than the old one, the contents are left unchanged up to the size of the newly allocated area.

When ptr is not a pointer to the storage area allocated by the calloc, malloc, or realloc function or when ptr is a pointer to the storage area released by the free or realloc function, operation is not guaranteed.

The CC-RX has a security facility for detecting illegal operations to storage areas. For details, refer to the -secure_malloc option in "2.5.4 Library Generator Options".