System.AllocMem

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function AllocMem(Size: NativeInt): Pointer;

C++

extern DELPHI_PACKAGE void * __fastcall AllocMem(NativeInt Size);

Properties

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

Description

AllocMem allocates a memory block and initializes each byte to zero.

AllocMem allocates a block of the given Size on the heap, and returns the address of this memory. Each byte in the allocated buffer is set to zero. To dispose of the buffer, use FreeMem. If there is not enough memory available to allocate the block, an EOutOfMemory exception is raised.

Note: If the memory does not need to be zero-initialized, use GetMem instead.

See Also


Code Examples