Allocates memory with alignment on current memory's page size boundary.
Size of memory block to allocate in bytes.
(out) a pointer to backbone storage. This is the pointer which must be passed to FreeMem to release this memory block.
A pointer to memory block of ASize bytes aligned at page boundary.
This function is the same as AllocMem except it also aligns result on memory's page size boundary.
That's it, if memory's page size is 4 Kb - then result is always aligned on 4 Kb (i.e. have 12 zeros at low part of pointer when represented in binary).
Thus, this function have an overhead of maximum 2 size of memory's page. For example, if memory's page size is 4 Kb - then this function will allocate 12 Kb for ASize less than 4 Kb, 16 Kb - for ASize less than 8 Kb and so on.
You shouldn't pass returned pointer to any memory releasing routines (like FreeMem). Instead, call FreeMem for AHolder.
Page size may be different on different platforms. Do not make any assumptions about it.
You can get current page size by calling PageSize.
Build date: 2019-07-01
Last edited: 2019-07-01
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_elowlevel_allocatepagealign.php