System.GetMemory

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetMemory(Size: NativeInt): Pointer; cdecl;

C++

extern DELPHI_PACKAGE void * __cdecl GetMemory(NativeInt Size);

Properties

Type Visibility Source Unit Parent
function public
System.pas
System.hpp
System System

Description

GetMemory allocates a memory block.

GetMemory allocates a block of the given Size on the heap, and returns the address of this memory. The bytes of the allocated buffer are not set to zero. To dispose of the buffer, use FreeMemory. If there is not enough memory available to allocate the block, an EOutOfMemory exception is raised.

If the memory needs to be zero-initialized, you can use AllocMem.

Note: GetMemory is the C++ compatible version of GetMem.

See Also

Code Examples