BloombergLP::bdlma::GuardingAllocator::allocate

Return a newly allocated maximally-aligned block of size bytes with an adjoining protected guard page.

Synopsis

Declared in <bdlma_guardingallocator.h>

virtual
void*
allocate(bsls::Types::size_type size) override;

Description

Return a newly-allocated maximally-aligned block of memory of the specified size (in bytes) that has a read/write protected guard page located immediately before or after it according to the GuardPageLocation indicated at construction. If size is 0, no memory is allocated and 0 is returned. Note that a multiple of the platform's memory page size is allocated for every call to this method.

Return Value

address of the newly allocated block, or a null pointer if size is 0

Parameters

NameDescription
sizenumber of bytes to allocate