ATLAS Offline Software
|
Wrapper for SG::ArenaHandle with pre-fetching. More...
#include <CaloPrefetch.h>
Public Types | |
typedef Base::pointer | pointer |
Pointer to an element. More... | |
typedef Base::iterator | iterator |
Iterators over elements. More... | |
typedef Base::const_iterator | const_iterator |
typedef ALLOC::template initParams< T, false, true > | defaultParams_t |
The class that initializes the default parameter set. More... | |
typedef ALLOC | alloc_t |
The Allocator we use. More... | |
Public Member Functions | |
ArenaHandlePrefetch () | |
Make. More... | |
void * | allocate () |
Return space for new element, then allocate and prefetch one more. More... | |
void | erase () |
Free all allocated elements. More... | |
iterator | begin () |
Starting iterator. More... | |
const_iterator | begin () const |
Starting const iterator. More... | |
iterator | end () |
Ending iterator. More... | |
const_iterator | end () const |
Ending const iterator. More... | |
void | free (pointer p) |
Free an element. More... | |
void | resetTo (pointer p) |
Reset pool back to a previous state. More... | |
const ALLOC::Params & | params () const |
Return our Allocator's parameters. More... | |
void | reset () |
Free all allocated elements (of this type in the current Arena). More... | |
void | reserve (size_t size) |
Set the total number of elements cached by the allocator (in the current Arena). More... | |
ArenaAllocatorBase::Stats | stats () const |
Return the statistics block for this allocator, for the current Arena. More... | |
Static Public Member Functions | |
static std::unique_ptr< ArenaAllocatorBase > | makeAllocator (const typename ALLOC::Params ¶ms) |
Internal helper: create a new Allocator instance. More... | |
Protected Member Functions | |
ALLOC * | allocator () |
Return our current Allocator. More... | |
const ALLOC * | allocator () const |
Return our current Allocator. More... | |
ArenaAllocatorBase * | baseAllocator () |
Return the current Allocator which we are referencing. More... | |
const ArenaAllocatorBase * | baseAllocator () const |
Return the current Allocator which we are referencing. More... | |
Static Protected Member Functions | |
template<class HANDLE , class DEFPARAMS > | |
static size_t | makeIndex (const typename ALLOC::Params *params) |
Find the index for creating an allocator. More... | |
Private Types | |
typedef SG::ArenaHandle< T, ALLOC > | Base |
Private Attributes | |
void * | m_buf [COUNT] |
LockedAllocator | m_allocator |
The associated allocator object. More... | |
Wrapper for SG::ArenaHandle with pre-fetching.
This class wraps SG::ArenaHandle and adds pre-fetching capability. Number of prefetched allocations is specified as a template argument so it must be a compile-time constant. By default a single allocation is pre-fetched, for tighter loops or if one allocates more than one item in the loop larger count can be specified.
Definition at line 102 of file CaloPrefetch.h.
|
inherited |
The Allocator
we use.
Definition at line 57 of file ArenaHandleBaseAllocT.h.
|
private |
Definition at line 104 of file CaloPrefetch.h.
|
inherited |
Definition at line 84 of file ArenaHandle.h.
|
inherited |
The class that initializes the default parameter set.
Definition at line 97 of file ArenaHandle.h.
|
inherited |
Iterators over elements.
(May only be instantiated if the underlying Allocator supports them.)
Definition at line 83 of file ArenaHandle.h.
|
inherited |
Pointer to an element.
Definition at line 79 of file ArenaHandle.h.
|
inline |
|
inline |
Return space for new element, then allocate and prefetch one more.
Definition at line 124 of file CaloPrefetch.h.
|
protectedinherited |
Return our current Allocator.
|
protectedinherited |
Return our current Allocator.
|
protectedinherited |
Return the current Allocator which we are referencing.
This may cause a new Allocator to be created.
|
protectedinherited |
Return the current Allocator which we are referencing.
This may cause a new Allocator to be created.
|
inherited |
Starting iterator.
This will iterate over all allocated elements (in unspecified order). It is at least a forward_iterator
. This may only be instantiated if the underlying Allocator supports iterators.
|
inherited |
Starting const iterator.
This will iterate over all allocated elements (in unspecified order). It is at least a forward_iterator
. This may only be instantiated if the underlying Allocator supports iterators.
|
inherited |
Ending iterator.
This may only be instantiated if the underlying Allocator supports iterators.
|
inherited |
Ending const iterator.
This may only be instantiated if the underlying Allocator supports iterators.
|
inline |
Free all allocated elements.
Definition at line 136 of file CaloPrefetch.h.
|
inherited |
Free an element.
p | The element to be freed. |
clear()
will be called on the element at this point, if it has been defined.
This may only be instantiated if it's supported by the underlying Allocator.
|
staticinherited |
Internal helper: create a new Allocator instance.
params | The parameters for the Allocator. |
|
staticprotectedinherited |
Find the index for creating an allocator.
params | Pointer to the supplied parameters. If null, use the result of DEFPARAMS(). |
We look up in the registry the Allocator name we get from params
(if this is blank, a name is derived from ALLOC
). If not found, then we register Allocator and return the new index.
|
inherited |
Return our Allocator's parameters.
|
inherited |
Set the total number of elements cached by the allocator (in the current Arena).
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.
Definition at line 111 of file ArenaHandleBase.cxx.
|
inherited |
Free all allocated elements (of this type in the current Arena).
All elements allocated in the current Arena by our associated Allocator 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.
Definition at line 71 of file ArenaHandleBase.cxx.
|
inherited |
Reset pool back to a previous state.
p | The pointer back to which to reset. |
This will free (a la reset
) the element p
and all elements that have been allocated after it from this allocator.
This may only be instantiated if it's supported by the underlying Allocator.
|
inherited |
Return the statistics block for this allocator, for the current Arena.
Definition at line 121 of file ArenaHandleBase.cxx.
|
privateinherited |
The associated allocator object.
Definition at line 160 of file ArenaHandleBase.h.
|
private |
Definition at line 147 of file CaloPrefetch.h.