- Function
Change the size of an allocated memory block.
- Header
- Declaration
void* __fastcall__ realloc (void* block, size_t size);
- Description
realloc
changes the size of the memory block pointed to byblock
tosize
bytes. Ifblock
isNULL
,realloc
behaves as ifmalloc
had been called. Ifsize
is zero,realloc
behaves as iffree
had been called. On error (not enough memory available),realloc
returnsNULL
.- Limits
- The part of the memory block that is returned will have its contents unchanged.
- This function is somewhat dangerous to use. Be careful to save the pointer you're passing somewhere else, otherwise
will loose your only copy of
ptr = realloc (ptr, size);ptr
ifrealloc
returnsNULL
.- The function is only available as fastcall function, so it may only be used in presence of a prototype.
- Availability
ISO 9899
- See also
_heapadd, _heapblocksize, _heapmaxavail, _heapmemavail, calloc, free, realloc
- Example
None.