|
Rosetta 3.5
|
#include <ArrayPool.fwd.hh>


Public Member Functions | |
| ArrayPool () | |
| Creation and destruction. More... | |
| ArrayPool (platform::Size block_size) | |
| Constructor with block-size specification. More... | |
| ArrayPool (platform::Size block_size, platform::Size array_size) | |
| Constructor with block-size and array-size specification. More... | |
| ~ArrayPool () | |
| platform::Size | array_size () const |
| Methods to read information about the pool size. More... | |
| platform::Size | block_size () const |
| Returns the number of arrays to allocate in each block. More... | |
| platform::Size | footprint () const |
| Returns the number of bytes occupied by all allocated and not-yet allocated arrays. More... | |
| void | set_array_size (platform::Size size) |
| Methods to modify the size of the pool. More... | |
| void | set_block_size (platform::Size size) |
| platform::Size | nblocks () const |
| Return the number of allocated array blocks. More... | |
| platform::Size | nallocated () const |
| Return the number of allocated arrays. If this were multiplied by the array_size_, then you'd have the amount of space spent representing the T arrays but you wouldn't have the amount of space spent representing the negative space linked list. More... | |
| platform::Size | noutstanding () const |
| Return the number of allocated arrays that have been requested by the user and are now "outstanding" in that they have to be returned before the array pool may be deleted. More... | |
| bool | empty () const |
| ArrayPoolElement< T > | new_array () |
| Methods for allocating and deallocating arrays from this pool. More... | |
| void | deallocate_array (ArrayPoolElement< T > const &element) |
| Free an ArrayPoolElement to the pool. The element is invalid after this call completes. More... | |
Private Member Functions | |
| void | create_new_block () |
| Add a new block to the pool and add the elements of this block to the negative space singly linked list. The block sizes and the array sizes must be set before this method is called and, so long as the ArrayPool is not empty, these sizes may not be altered. More... | |
| void | clear () |
| Deallocate all the allocated blocks. The pool must be empty before this should be called or dangling references are likely. More... | |
| bool | mine (NegSpaceElement< T > const *neg_element) const |
| Determine if a given pointer to a negative-space element belongs to this pool. The compiler cannot ensure that when a ArrayPoolElement is handed to the deallocate_array method that it belongs to the pool being invoked upon. More... | |
Private Attributes | |
| platform::Size | block_size_ |
| platform::Size | array_size_ |
| platform::Size | nblocks_ |
| platform::Size | nnegative_ |
| NegSpaceElement< T > | neg_begin_ |
| std::list< NegSpaceElement< T > * > | neg_space_blocks_ |
| std::list< T * > | array_blocks_ |
Definition at line 33 of file ArrayPool.fwd.hh.
|
inline |
Creation and destruction.
Default constructor uses a block size of 32
Definition at line 238 of file ArrayPool.hh.
|
inline |
Constructor with block-size specification.
Definition at line 246 of file ArrayPool.hh.
|
inline |
Constructor with block-size and array-size specification.
Definition at line 254 of file ArrayPool.hh.
|
inline |
Definition at line 261 of file ArrayPool.hh.
|
inline |
Methods to read information about the pool size.
Returns the size of each array to be allocated.
Definition at line 272 of file ArrayPool.hh.
|
inline |
Returns the number of arrays to allocate in each block.
Definition at line 277 of file ArrayPool.hh.
|
inlineprivate |
Deallocate all the allocated blocks. The pool must be empty before this should be called or dangling references are likely.
Definition at line 470 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::set_array_size(), core::graph::ArrayPool< Real >::set_block_size(), and core::graph::ArrayPool< Real >::~ArrayPool().
|
inlineprivate |
Add a new block to the pool and add the elements of this block to the negative space singly linked list. The block sizes and the array sizes must be set before this method is called and, so long as the ArrayPool is not empty, these sizes may not be altered.
This array pool supports, but does not recommend using, array sizes of 0. The resulting ArrayPoolElements have Array0 objecst that point at null, and therefore, should never be dereferenced. However, there is nothing inherrently wrong with pointing at null, or with having an array that is never examined, and so it is supported.
Definition at line 390 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::new_array().
|
inline |
Free an ArrayPoolElement to the pool. The element is invalid after this call completes.
Definition at line 362 of file ArrayPool.hh.
Referenced by core::scoring::EnergyGraph::deallocate_arraypoolelement().
|
inline |
Definition at line 337 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::clear(), core::graph::ArrayPool< Real >::set_array_size(), core::graph::ArrayPool< Real >::set_block_size(), and core::graph::ArrayPool< Real >::~ArrayPool().
|
inline |
Returns the number of bytes occupied by all allocated and not-yet allocated arrays.
Approximate the cost of each list element in the two std::lists as 4 times the cost of a pointer.
Definition at line 286 of file ArrayPool.hh.
Referenced by core::scoring::EnergyGraph::count_dynamic_memory().
|
inlineprivate |
Determine if a given pointer to a negative-space element belongs to this pool. The compiler cannot ensure that when a ArrayPoolElement is handed to the deallocate_array method that it belongs to the pool being invoked upon.
This method is too slow to include in release builds, but is here to ensure in debug mode that two pools don't accidentally start crossing their pointers and "sharing" data, since that would be disasterous.
Definition at line 502 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::deallocate_array().
|
inline |
Return the number of allocated arrays. If this were multiplied by the array_size_, then you'd have the amount of space spent representing the T arrays but you wouldn't have the amount of space spent representing the negative space linked list.
Definition at line 326 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::deallocate_array(), core::graph::ArrayPool< Real >::empty(), and core::graph::ArrayPool< Real >::noutstanding().
|
inline |
Return the number of allocated array blocks.
Definition at line 318 of file ArrayPool.hh.
|
inline |
Methods for allocating and deallocating arrays from this pool.
Request a new ArrayPoolElement from the pool. This method will enlarge the pool if it has grown to its capacity.
Definition at line 347 of file ArrayPool.hh.
|
inline |
Return the number of allocated arrays that have been requested by the user and are now "outstanding" in that they have to be returned before the array pool may be deleted.
Definition at line 333 of file ArrayPool.hh.
|
inline |
Methods to modify the size of the pool.
Set the size of the arrays that the pool is meant to allocate.
The
Definition at line 297 of file ArrayPool.hh.
Referenced by core::scoring::EnergyGraph::active_score_types().
|
inline |
Definition at line 307 of file ArrayPool.hh.
|
private |
Definition at line 524 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::clear(), and core::graph::ArrayPool< Real >::create_new_block().
|
private |
Definition at line 518 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::array_size(), core::graph::ArrayPool< Real >::create_new_block(), core::graph::ArrayPool< Real >::footprint(), core::graph::ArrayPool< Real >::new_array(), and core::graph::ArrayPool< Real >::set_array_size().
|
private |
Definition at line 517 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::block_size(), core::graph::ArrayPool< Real >::create_new_block(), core::graph::ArrayPool< Real >::footprint(), core::graph::ArrayPool< Real >::mine(), core::graph::ArrayPool< Real >::nallocated(), and core::graph::ArrayPool< Real >::set_block_size().
|
private |
|
private |
Definition at line 521 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::clear(), core::graph::ArrayPool< Real >::create_new_block(), core::graph::ArrayPool< Real >::deallocate_array(), and core::graph::ArrayPool< Real >::new_array().
|
private |
Definition at line 523 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::clear(), core::graph::ArrayPool< Real >::create_new_block(), and core::graph::ArrayPool< Real >::mine().
|
private |
Definition at line 520 of file ArrayPool.hh.
Referenced by core::graph::ArrayPool< Real >::clear(), core::graph::ArrayPool< Real >::create_new_block(), core::graph::ArrayPool< Real >::deallocate_array(), core::graph::ArrayPool< Real >::empty(), core::graph::ArrayPool< Real >::new_array(), and core::graph::ArrayPool< Real >::noutstanding().
1.8.4