Dune Core Modules (2.6.0)
poolallocator.hh
Go to the documentation of this file.
153 };
263 };
459 static_assert(sizeof(T)<=chunkSize, "Library Error: chunkSize must be able to hold at least one value");
460 static_assert(sizeof(Reference)<=chunkSize, "Library Error: chunkSize must be able to hold at least one reference");
461 static_assert((chunkSize - (alignment - 1)) % alignment == 0, "Library Error: compiler cannot calculate!");
463 static_assert(elements*alignedSize<=chunkSize, "Library Error: aligned elements must fit into chuck!");
471 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:247
Pool< T, size > PoolType
The type of the memory pool we use.
Definition: poolallocator.hh:376
const_pointer address(const_reference x) const
Convert a reference to a pointer.
Definition: poolallocator.hh:359
const T & const_reference
The constant reference type.
Definition: poolallocator.hh:283
T value_type
Type of the values we construct and allocate.
Definition: poolallocator.hh:254
PoolAllocator(const PoolAllocator &)
Copy constructor that does not copy the memory pool.
Definition: poolallocator.hh:311
const T * const_pointer
The constant pointer type.
Definition: poolallocator.hh:273
pointer address(reference x) const
Convert a reference to a pointer.
Definition: poolallocator.hh:353
PoolAllocator(const PoolAllocator< U, u > &)
Copy Constructor that does not copy the memory pool.
Definition: poolallocator.hh:304
std::ptrdiff_t difference_type
The difference_type.
Definition: poolallocator.hh:293
@ size
The number of objects to fit into one memory chunk allocated.
Definition: poolallocator.hh:262
int max_size() const noexcept
Not correctly implemented, yet!
Definition: poolallocator.hh:364
@ elements
The number of element each chunk can hold.
Definition: poolallocator.hh:152
@ chunkSize
The size of each chunk memory chunk.
Definition: poolallocator.hh:145
@ 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:582
void print(std::ostream &os)
Print elements in pool for debugging.
Definition: poolallocator.hh:487
pointer allocate(std::size_t n, const_pointer hint=0)
Allocates objects.
Definition: poolallocator.hh:566
void deallocate(pointer p, std::size_t n)
Free objects.
Definition: poolallocator.hh:575
void destroy(pointer p)
Destroy an object without freeing memory.
Definition: poolallocator.hh:588
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:233
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:255
Statically compute the least common multiple of two integers.
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
(Dec 26, 23:30, 2024)