GETMEM
is used to request a chunk of memory that is reserved for your application.
Do not mix, New and FreeMem, or GetMem and Dispose, internally they are using different regions of memory.
const BufSize=4096; var Buffer:Pointer; Begin GetMem(Buffer, BufSize); If Buffer=Nil then Exit; // Allocation request failed, no free memory available! {.. Use the Buffer ..} // When finished: FreeMem(Buffer, BufSize); End.Source: Reserved Words