BloombergLP::bdlma::CountingAllocator::allocate

Return a newly-allocated block of memory of the specified size.

Synopsis

Declared in <bdlma_countingallocator.h>

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

Description

Return a newly-allocated block of memory of the specified size (in bytes). If size is 0, a null pointer is returned with no other effect (e.g., on allocation statistics). Otherwise, invoke the allocate method of the allocator supplied at construction, and increment the number of currently (and cumulatively) allocated bytes by size.

Return Value

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

Parameters

NameDescription
sizenumber of bytes to allocate