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.
Synopsis
Declared in <bdlma_guardingallocator.h>
class GuardingAllocator
: public bslma::Allocator
Base Classes
Name |
Description |
This protocol class provides a pure abstract interface and contract for clients and suppliers of raw memory. If the requested memory cannot be returned, the contract requires that an |
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. Optionally specify a |
|
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 memory of (at least) the specified positive |
|
Return the memory block at the specified |
|
Return |
Created with MrDocs