Concrete thread‐safe guarding allocator that adjoins a protected guard page to each allocated block.
Synopsis
Declared in <bdlma_guardingallocator.h>
class GuardingAllocator
: public bslma::Allocator
Description
This class defines a concrete thread‐safe "guarding" allocator mechanism that implements the bslma::Allocator protocol, and adjoins a read/write protected guard page to each block of memory returned by the allocate method. The guard page is placed immediately before or immediately following the block returned from allocate according to the GuardPageLocation enumerator value (optionally) supplied at construction. Note that, unlike many other allocators, an allocator cannot be (optionally) supplied at construction; instead, a system facility is used that allocates blocks of memory in multiples of the system page size. Also note that this allocator is intended for debugging purposes only.
Base Classes
Name |
Description |
Pure abstract protocol for clients and suppliers of raw memory. |
Type Aliases
Name |
Description |
Alias for an unsigned integral type capable of representing the number of bytes in this platform's virtual address space. |
Enums
Name |
Description |
Enumerate the configuration options for |
Member Functions
Name |
Description |
|
Create a guarding allocator. |
|
Destroy this allocator object. Note that destroying this allocator has no effect on any outstanding allocated memory. |
|
|
Return the memory block at the specified |
|
|
|
|
|
Static Member Functions
Name |
Description |
Throw |
Protected Member Functions
Name |
Description |
|
Return a newly allocated block of at least |
|
Return the memory block at |
|
Return whether this allocator can exchange memory with |
Created with MrDocs