![]() |
ATLAS Offline Software
|
Forward declaration. More...
#include <ArenaHeapSTLAllocator.h>
Public Types | |
| typedef std::allocator< T > | base |
| typedef base::value_type | value_type |
| Standard STL allocator typedefs. | |
| typedef base::size_type | size_type |
| typedef base::difference_type | difference_type |
| typedef T * | pointer |
| Standard STL allocator typedefs. | |
| typedef const T * | const_pointer |
| typedef T & | reference |
| typedef const T & | const_reference |
| 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> | |
| ArenaNonConstHeapSTLAllocator (const ArenaHeapSTLAllocator< 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. | |
| 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). | |
| void | swap (ArenaHeapSTLAllocator &a) |
| Swap. | |
| ArenaHeapSTLAllocator | select_on_container_copy_construction () const |
| Return allocator to use for a copy-constructed container. | |
| bool | operator== (const ArenaHeapSTLAllocator &other) const |
| Equality test. | |
| bool | operator!= (const ArenaHeapSTLAllocator &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. | |
Static Public Member Functions | |
| template<class CONT> | |
| static ArenaNonConstHeapSTLAllocator< T > | get_allocator (CONT &c) |
| Return an allocator supporting non-const methods from a non-const container reference. | |
Public Attributes | |
| T | elements |
| STL member. | |
Private Attributes | |
| ArenaBlockAllocatorBase * | m_poolptr_nc |
| Non-const pointer to the underlying allocator. | |
| size_t | m_nblock |
| Saved hinted number of objects per block. | |
| std::string | m_name |
| Saved allocator name. | |
| const ArenaBlockAllocatorBase * | m_poolptr |
| Point at an underlying allocator from a different specialization. | |
| ArenaHeapAllocator | m_pool |
| The underlying allocator. | |
Forward declaration.
STL-style allocator wrapper for ArenaHeapAllocator.
Non-const variant for the case of the vetoed type.
See documentation above for details.
Definition at line 466 of file ArenaHeapSTLAllocator.h.
|
inherited |
Definition at line 376 of file ArenaHeapSTLAllocator.h.
|
inherited |
Definition at line 98 of file ArenaHeapSTLAllocator.h.
|
inherited |
Definition at line 100 of file ArenaHeapSTLAllocator.h.
|
inherited |
Definition at line 381 of file ArenaHeapSTLAllocator.h.
|
inherited |
Standard STL allocator typedefs.
Definition at line 97 of file ArenaHeapSTLAllocator.h.
|
inherited |
When we assign to a container, the target should retain its allocator.
Definition at line 106 of file ArenaHeapSTLAllocator.h.
|
inherited |
Move allocators on move/swap.
Definition at line 109 of file ArenaHeapSTLAllocator.h.
|
inherited |
Definition at line 110 of file ArenaHeapSTLAllocator.h.
|
inherited |
Definition at line 99 of file ArenaHeapSTLAllocator.h.
|
inherited |
Definition at line 380 of file ArenaHeapSTLAllocator.h.
|
inherited |
Standard STL allocator typedefs.
Definition at line 379 of file ArenaHeapSTLAllocator.h.
| SG::ArenaNonConstHeapSTLAllocator< T >::ArenaNonConstHeapSTLAllocator | ( | const ArenaHeapSTLAllocator< 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. |
|
inherited |
Call the T destructor.
| p | Location of the memory. |
| void SG::ArenaNonConstHeapSTLAllocator< 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).
|
staticinherited |
Return an allocator supporting non-const methods from a non-const container reference.
| c | The (non-const) container. |
|
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::ArenaNonConstHeapSTLAllocator< T >::protect | ( | ) |
Write-protect the memory managed by this allocator.
Adjust protection on the memory managed by this allocator to disallow writes.
| void SG::ArenaNonConstHeapSTLAllocator< 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::ArenaNonConstHeapSTLAllocator< 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::ArenaNonConstHeapSTLAllocator< T >::unprotect | ( | ) |
Write-enable the memory managed by this allocator.
Adjust protection on the memory managed by this allocator to allow writes.
|
inherited |
STL member.
|
privateinherited |
Saved allocator name.
Definition at line 452 of file ArenaHeapSTLAllocator.h.
|
privateinherited |
Saved hinted number of objects per block.
Definition at line 449 of file ArenaHeapSTLAllocator.h.
|
privateinherited |
The underlying allocator.
Definition at line 342 of file ArenaHeapSTLAllocator.h.
|
privateinherited |
Point at an underlying allocator from a different specialization.
Definition at line 455 of file ArenaHeapSTLAllocator.h.
|
private |
Non-const pointer to the underlying allocator.
Definition at line 542 of file ArenaHeapSTLAllocator.h.