Creates a dynamic variable and a pointer to the address of the block.
Unit
System
Category
dynamic allocation routines
Delphi syntax:
procedure GetMem(var P: Pointer; Size: Integer);
Description
P is a variable of any pointer type. Size is an expression specifying the size in bytes of the dynamic variable to allocate. Access the newly allocated memory by dereferencing the pointer; that is, use P^.
If there isn't enough memory available to allocate the dynamic variable, an EOutOfMemory exception is raised.
Note: It is considered preferable to use the New and Dispose procedures rather than GetMem and FreeMem.