- Function
Change the size of an allocated memory block.
- Header
- Declaration
void* __fastcall__ realloc (void* block, size_t size);- Description
reallocchanges the size of the memory block pointed to byblocktosizebytes. IfblockisNULL,reallocbehaves as ifmallochad been called. Ifsizeis zero,reallocbehaves as iffreehad been called. On error (not enough memory available),reallocreturnsNULL.- 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 ofptr = realloc (ptr, size);ptrifreallocreturnsNULL.- 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.