[#LockedPageAllocator-AllocateLocked]
= xref:LockedPageAllocator.adoc[LockedPageAllocator]::AllocateLocked
:relfileprefix: ../
:mrdocs:

Allocate and lock memory pages&period; If len is not a multiple of the system page size, it is rounded up&period; Returns nullptr in case of allocation failure&period;

== Synopsis

Declared in `&lt;support&sol;lockedpool&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
void*
AllocateLocked(
    size&lowbar;t len,
    bool* lockingSuccess) = 0;
----

== Description

If locking the memory pages could not be accomplished it will still return the memory, however the lockingSuccess flag will be false&period; lockingSuccess is undefined if the allocation fails&period;

== Return Value

Pointer to the allocated memory, or nullptr on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *len*
| Number of bytes to allocate, rounded up to the page size&period;
| *lockingSuccess*
| Set to true if the pages were locked, false otherwise&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
