Resizes a memory block.
Unit
Syntax
function EurekaReallocMem(
P: Pointer;
Size: PtrInt
): Pointer;
Parameters
P [in]
A pointer to memory block returned by EurekaGetMem, EurekaTryGetMem or EurekaAllocMem.
Size [in]
New size of P in bytes. Size can be larger or smaller than original size of P. If Size is larger than old size, then the memory block will be expanded (with non initialized memory). If Size is smaller than old size, then the memory block will be truncated.
Return value
A pointer to allocated memory block of Size bytes. This value may or may not be equal to P. Old content of P is preserved. If Size is larger than old size of P, then newly added memory is not zero-initialized.
Remarks
EurekaReallocMem reallocates a memory block. EurekaGetMem allocates a block of the given Size on the heap. If you have to change the size of this memory block, call EurekaReallocMem, passing the existing memory block pointer in P and the revised block size in Size. If EurekaReallocMem can't expand the memory block pointed to by P, it frees the referenced memory and copies the values to the newly allocated memory that is returned. The content of the newly allocated memory is not set to zero.
Note |
Do not call |
Important! |
|
See also
| • | MemLeaksError Event Handler |
| • | MemLeaksErrorsToIgnore Global Variable |
| Send feedback... |
Build date: 2026-10-21 Last edited: 2026-10-21 |
|
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_EurekaReallocMem |
|