DUNE-FEM (unstable)
poolallocator.hh
Go to the documentation of this file.
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
432 static_assert(sizeof(T)<=chunkSize, "Library Error: chunkSize must be able to hold at least one value");
433 static_assert(sizeof(Reference)<=chunkSize, "Library Error: chunkSize must be able to hold at least one reference");
436 static_assert(elements*alignedSize<=chunkSize, "Library Error: aligned elements must fit into chuck!");
444 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:349
const_pointer address(const_reference x) const
Convert a reference to a pointer.
Definition: poolallocator.hh:332
const T & const_reference
The constant reference type.
Definition: poolallocator.hh:256
T value_type
Type of the values we construct and allocate.
Definition: poolallocator.hh:230
PoolAllocator(const PoolAllocator &)
Copy constructor that does not copy the memory pool.
Definition: poolallocator.hh:284
const T * const_pointer
The constant pointer type.
Definition: poolallocator.hh:246
pointer address(reference x) const
Convert a reference to a pointer.
Definition: poolallocator.hh:326
PoolAllocator(const PoolAllocator< U, u > &)
Copy Constructor that does not copy the memory pool.
Definition: poolallocator.hh:277
std::ptrdiff_t difference_type
The difference_type.
Definition: poolallocator.hh:266
int max_size() const noexcept
Not correctly implemented, yet!
Definition: poolallocator.hh:337
static constexpr int size
The number of objects to fit into one memory chunk allocated.
Definition: poolallocator.hh:236
static constexpr int alignment
The alignment that suits both the MemberType and the Reference (i.e. their least common multiple).
Definition: poolallocator.hh:127
static constexpr int alignedSize
The aligned size of the type.
Definition: poolallocator.hh:135
static constexpr int chunkSize
The size of each chunk memory chunk.
Definition: poolallocator.hh:144
static constexpr int size
Size requirement. At least one object has to stored.
Definition: poolallocator.hh:120
static constexpr int unionSize
The size of a union of Reference and MemberType.
Definition: poolallocator.hh:113
T MemberType
The type of object we allocate memory for.
Definition: poolallocator.hh:108
static constexpr int elements
The number of element each chunk can hold.
Definition: poolallocator.hh:150
void construct(pointer p, const_reference value)
Construct an object.
Definition: poolallocator.hh:555
void print(std::ostream &os)
Print elements in pool for debugging.
Definition: poolallocator.hh:460
pointer allocate(std::size_t n, const_pointer hint=0)
Allocates objects.
Definition: poolallocator.hh:539
void deallocate(pointer p, std::size_t n)
Free objects.
Definition: poolallocator.hh:548
void destroy(pointer p)
Destroy an object without freeing memory.
Definition: poolallocator.hh:561
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:238
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:260
STL namespace.
Get the 'const' version of a reference to a mutable object.
Definition: genericiterator.hh:87
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Nov 21, 23:30, 2024)