Skip to content

ReAlloc

See Also: Memory Management Functions

Purpose

Changes the size of a block of memory.

Return Type

Pointer

Syntax

Realloc({aPointer}, {iNewSize})

Where:

  • {aPointer} is a valid Pointer (allocated on the process heap using Alloc).
  • {iNewSize} is the new desired size in bytes.

What It Does

ReAlloc changes the size of the given memory block, aPointer, reallocating it to the size specified in iNewSize. The return value is either a pointer to a valid memory address (indicating success) or 0 in case of failure.

Example

Move (Realloc(pMemory, 10000)) to pNewMemoryBlock
If (pNewMemoryBlock > 0) ...