Root > Reference > All Functions > EurekaGetMem

Function EurekaGetMem

Previous pageReturn to chapter overviewNext page   

Allocates a memory block via EurekaLog memory filter.

 

Unit

EMemLeaks

 

Syntax

 

Code (Delphi)

function EurekaGetMem(

Size: PtrInt

): Pointer;

 

Parameters

Size [in]

A size of memory block to allocate (in bytes).

 

Return value

A pointer to allocated memory block of Size bytes. Memory block is not zero-initialized.

 

Remarks

EurekaGetMem 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 EurekaFreeMem. If there is not enough memory available to allocate the block, an leOutOfMemory error is raised.

Note

If the memory block must be initialized with zero, you can use EurekaAllocMem.

 

Note

Do not call EurekaGetMem manually. This function will be called automatically when you call GetMem function when EurekaLog's memory filter is installed.

 

 

Important!

EurekaGetMem usually never returns nil nor raise exceptions. Memory allocation errors are considered to be fatal. EurekaLog will call MemLeaksError event handler to hanle memory allocation error and terminate the application. See also: MemLeaksErrorsToIgnore global variable. You can use an explicit call to EurekaTryGetMem function to allocate memory with ignoring errors.

 

 

See also

MemLeaksError Event Handler
MemLeaksErrorsToIgnore Global Variable



Send feedback... Build date: 2024-09-30
Last edited: 2024-09-30
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/topic_function_ememleaks_eurekagetmem.php