Dune Core Modules (2.8.0)
poolallocator.hh
Go to the documentation of this file.
150 };
239 };
435 static_assert(sizeof(T)<=chunkSize, "Library Error: chunkSize must be able to hold at least one value");
436 static_assert(sizeof(Reference)<=chunkSize, "Library Error: chunkSize must be able to hold at least one reference");
439 static_assert(elements*alignedSize<=chunkSize, "Library Error: aligned elements must fit into chuck!");
447 std::cerr<<"There are still "<<allocated_<<" allocated elements by the Pool<"<<typeid(T).name()<<","<<S<<"> "
An allocator managing a pool of objects for reuse.
Definition: poolallocator.hh:223
Pool< T, size > PoolType
The type of the memory pool we use.
Definition: poolallocator.hh:352
const_pointer address(const_reference x) const
Convert a reference to a pointer.
Definition: poolallocator.hh:335
const T & const_reference
The constant reference type.
Definition: poolallocator.hh:259
T value_type
Type of the values we construct and allocate.
Definition: poolallocator.hh:230
@ size
The number of objects to fit into one memory chunk allocated.
Definition: poolallocator.hh:238
PoolAllocator(const PoolAllocator &)
Copy constructor that does not copy the memory pool.
Definition: poolallocator.hh:287
const T * const_pointer
The constant pointer type.
Definition: poolallocator.hh:249
pointer address(reference x) const
Convert a reference to a pointer.
Definition: poolallocator.hh:329
PoolAllocator(const PoolAllocator< U, u > &)
Copy Constructor that does not copy the memory pool.
Definition: poolallocator.hh:280
std::ptrdiff_t difference_type
The difference_type.
Definition: poolallocator.hh:269
int max_size() const noexcept
Not correctly implemented, yet!
Definition: poolallocator.hh:340
@ elements
The number of element each chunk can hold.
Definition: poolallocator.hh:149
@ chunkSize
The size of each chunk memory chunk.
Definition: poolallocator.hh:143
@ unionSize
The size of a union of Reference and MemberType.
Definition: poolallocator.hh:112
@ alignment
The alignment that suits both the MemberType and the Reference (i.e. their least common multiple).
Definition: poolallocator.hh:126
@ size
Size requirement. At least one object has to stored.
Definition: poolallocator.hh:119
T MemberType
The type of object we allocate memory for.
Definition: poolallocator.hh:106
void construct(pointer p, const_reference value)
Construct an object.
Definition: poolallocator.hh:558
void print(std::ostream &os)
Print elements in pool for debugging.
Definition: poolallocator.hh:463
pointer allocate(std::size_t n, const_pointer hint=0)
Allocates objects.
Definition: poolallocator.hh:542
void deallocate(pointer p, std::size_t n)
Free objects.
Definition: poolallocator.hh:551
void destroy(pointer p)
Destroy an object without freeing memory.
Definition: poolallocator.hh:564
EnableIfInterOperable< T1, T2, bool >::type operator==(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for equality.
Definition: iteratorfacades.hh:235
EnableIfInterOperable< T1, T2, bool >::type operator!=(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for inequality.
Definition: iteratorfacades.hh:257
STL namespace.
Get the 'const' version of a reference to a mutable object.
Definition: genericiterator.hh:85
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Nov 21, 23:30, 2024)