![]() |
ATLAS Offline Software
|
Forward declaration. More...
#include <ArenaPoolSTLAllocator.h>
Public Types | |
| typedef T * | pointer |
| Standard STL allocator typedefs. | |
| typedef const T * | const_pointer |
| typedef T & | reference |
| typedef const T & | const_reference |
| typedef T | value_type |
| typedef size_t | size_type |
| typedef ptrdiff_t | difference_type |
| typedef std::false_type | propagate_on_container_copy_assignment |
| When we assign to a container, the target should retain its allocator. | |
| typedef std::true_type | propagate_on_container_move_assignment |
| Move allocators on move/swap. | |
| typedef std::true_type | propagate_on_container_swap |
Public Member Functions | |
| template<class U, class V> | |
| ArenaNonConstPoolSTLAllocator (const ArenaPoolSTLAllocator< U, V > &a, ArenaBlockAllocatorBase *poolptr_nc) | |
| Constructor. | |
| void | reset () |
| Free all allocated elements. | |
| void | erase () |
| Free all allocated elements and release memory back to the system. | |
| void | reserve (size_t size) |
| Set the total number of elements cached by the allocator. | |
| void | protect () |
| Write-protect the memory managed by this allocator. | |
| void | unprotect () |
| Write-enable the memory managed by this allocator. | |
| void | swap (ArenaPoolSTLAllocator &a) |
| Swap. | |
| ArenaPoolSTLAllocator | select_on_container_copy_construction () const |
| Return allocator to use for a copy-constructed container. | |
| bool | operator== (const ArenaPoolSTLAllocator &other) const |
| Equality test. | |
| bool | operator!= (const ArenaPoolSTLAllocator &other) const |
| Inequality test. | |
| pointer | address (reference x) const |
| Convert a reference to an address. | |
| pointer | allocate (size_type n, const void *hint=0) |
| Allocate new objects. | |
| void | deallocate (pointer, size_type n) |
| Deallocate objects. | |
| size_type | max_size () const throw () |
| Return the maximum number of objects we can allocate at once. | |
| void | construct (pointer p, Args &&... args) |
Call the T constructor. | |
| void | destroy (pointer p) |
Call the T destructor. | |
| size_t | nblock () const |
| Return the hinted number of objects allocated per block. | |
| const std::string & | name () const |
| Return the name of this allocator. | |
| ArenaAllocatorBase::Stats | stats () const |
| Return the statistics block for this allocator. | |
| const ArenaBlockAllocatorBase * | poolptr () const |
| Return a pointer to the underlying allocator (may be 0). | |
Private Attributes | |
| ArenaBlockAllocatorBase * | m_poolptr_nc |
| Non-const pointer to the underlying allocator. | |
| ArenaPoolAllocator | m_pool |
| The underlying allocator. | |
Forward declaration.
STL-style allocator wrapper for ArenaPoolAllocator.
Non-const variant for the case of the vetoed type.
See documentation above for details.
Definition at line 542 of file ArenaPoolSTLAllocator.h.
|
inherited |
Definition at line 110 of file ArenaPoolSTLAllocator.h.
|
inherited |
Definition at line 112 of file ArenaPoolSTLAllocator.h.
|
inherited |
Definition at line 115 of file ArenaPoolSTLAllocator.h.
|
inherited |
Standard STL allocator typedefs.
Definition at line 109 of file ArenaPoolSTLAllocator.h.
|
inherited |
When we assign to a container, the target should retain its allocator.
Definition at line 118 of file ArenaPoolSTLAllocator.h.
|
inherited |
Move allocators on move/swap.
Definition at line 121 of file ArenaPoolSTLAllocator.h.
|
inherited |
Definition at line 122 of file ArenaPoolSTLAllocator.h.
|
inherited |
Definition at line 111 of file ArenaPoolSTLAllocator.h.
|
inherited |
Definition at line 114 of file ArenaPoolSTLAllocator.h.
|
inherited |
Definition at line 113 of file ArenaPoolSTLAllocator.h.
| SG::ArenaNonConstPoolSTLAllocator< T >::ArenaNonConstPoolSTLAllocator | ( | const ArenaPoolSTLAllocator< U, V > & | a, |
| ArenaBlockAllocatorBase * | poolptr_nc ) |
Constructor.
| a | Allocator to reference. |
| poolptr_nc | Non-const pointer to the underlying allocator. |
|
inherited |
Convert a reference to an address.
|
inherited |
Allocate new objects.
| n | Number of objects to allocate. Must be 1. |
| hint | Allocation hint. Not used. |
|
inherited |
Call the T constructor.
| p | Location of the memory. |
| args | Arguments to pass to the constructor. |
|
inherited |
Deallocate objects.
| n | Number of objects to deallocate. Must be 1. |
This implementation doesn't do anything.
|
inherited |
Call the T destructor.
| p | Location of the memory. |
| void SG::ArenaNonConstPoolSTLAllocator< T >::erase | ( | ) |
Free all allocated elements and release memory back to the system.
All elements allocated are freed, and all allocated blocks of memory are released back to the system. destructor should be called on them if it was provided (preceded by clear if provided and mustClear was set).
|
inherited | ||||||||||||
Return the maximum number of objects we can allocate at once.
This always returns 1.
|
inherited |
Return the name of this allocator.
|
inherited |
Return the hinted number of objects allocated per block.
|
inherited |
Inequality test.
Two allocators should compare equal if objects allocated by one can be deallocated by the other. We should just check if they are the same object.
|
inherited |
Equality test.
Two allocators should compare equal if objects allocated by one can be deallocated by the other. We should just check if they are the same object.
|
inherited |
Return a pointer to the underlying allocator (may be 0).
| void SG::ArenaNonConstPoolSTLAllocator< T >::protect | ( | ) |
Write-protect the memory managed by this allocator.
Adjust protection on the memory managed by this allocator to disallow writes.
| void SG::ArenaNonConstPoolSTLAllocator< T >::reserve | ( | size_t | size | ) |
Set the total number of elements cached by the allocator.
| size | The desired pool size. |
This allows changing the number of elements that are currently free but cached. Any allocated elements are not affected by this call.
If size is greater than the total number of elements currently cached, then more will be allocated. This will preferably done with a single block, but that is not guaranteed; in addition, the allocator may allocate more elements than is requested.
If size is smaller than the total number of elements currently cached, as many blocks as possible will be released back to the system. It may not be possible to release the number of elements requested; this should be implemented on a best-effort basis.
| void SG::ArenaNonConstPoolSTLAllocator< T >::reset | ( | ) |
Free all allocated elements.
All elements allocated are returned to the free state. clear should be called on them if it was provided. The elements may continue to be cached internally, without returning to the system.
|
inherited |
Return allocator to use for a copy-constructed container.
When we copy-construct a container, we want the new allocator to copy parameters from the old one, but not the data.
|
inherited |
Return the statistics block for this allocator.
|
inherited |
Swap.
| void SG::ArenaNonConstPoolSTLAllocator< T >::unprotect | ( | ) |
Write-enable the memory managed by this allocator.
Adjust protection on the memory managed by this allocator to allow writes.
|
privateinherited |
The underlying allocator.
Definition at line 349 of file ArenaPoolSTLAllocator.h.
|
private |
Non-const pointer to the underlying allocator.
Definition at line 618 of file ArenaPoolSTLAllocator.h.