BloombergLP::bdls::MemoryUtil::allocate

Allocate page-aligned memory of the specified size.

Synopsis

Declared in <bdls_memoryutil.h>

static
void*
allocate(int numBytes);

Description

Allocate an area of memory of the specified size numBytes, aligned on a page boundary. Return a pointer to allocated memory on success, and a null pointer otherwise. Note that the allocated memory is readable and writable, and read/write access to this memory, if revoked, must be restored before deallocation.

Return Value

a pointer to allocated memory on success, and a null pointer otherwise

Parameters

NameDescription
numBytesnumber of bytes to allocate