RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System.ReallocMem Function

ReallocMem reallocates a memory block.

Pascal
procedure ReallocMem(var P: Pointer; Size: Integer);
C++
ReallocMem(void * P, int Size);

System

GetMem allocates a block of the given Size on the heap. If you need to change the size of this memory block, call ReallocMem, passing the existing memory block pointer in P, and the revised block size in Size. If ReallocMem can't expand the memory block pointed to by P, it frees the referenced memory and copies the values to the newly allocated memory that is returned.  

If there isn't enough memory available to extend the memory block to the desired size, an EOutOfMemory exception is raised.

Note: ReallocMemory is the C++ compatible version of ReallocMem.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!