47 #ifndef LIB_ALLOCATION_CLUSTER_H 48 #define LIB_ALLOCATION_CLUSTER_H 100 template<
class TY,
typename...ARGS>
102 create (ARGS&& ...args)
104 TY* obj =
new(allocation<TY>()) TY (std::forward<ARGS> (args)...);
114 size_t count()
const;
152 using ManagerTable = std::vector<HMemManager,Allo>;
159 handler (
size_t slot)
161 ASSERT (0<slot && slot<=typeHandlers_.size());
162 return typeHandlers_[slot-1];
166 handler (
size_t slot)
const 168 ASSERT (0<slot && slot<=typeHandlers_.size());
169 return typeHandlers_[slot-1];
194 void (*killIt)(
void*);
198 : allocSize(sizeof(TY)),
234 TY* p =
static_cast<TY*
>(obj);
static size_t maxTypeIDs
storage for static bookkeeping of type allocation slots
size_t count() const
helper for diagnostics
Some wrappers for coping with ownership problems.
void finishAlloc(size_t &slot, void *)
enrol the allocation after successful ctor call
#define INSTANCEOF(CLASS, EXPR)
shortcut for subclass test, intended for assertions only.
Any copy and copy construction prohibited.
Implementation namespace for support and library code.
TY & commit(TY *obj)
finish the allocation after the ctor is successful
A mechanism to take ownership without allowing copy.
Addendum to scoped-holder.hpp for transferring the lifecycle management to another instance...
Mix-Ins to allow or prohibit various degrees of copying and cloning.
size_t countActiveInstances(size_t &slot) const
void * initiateAlloc(size_t &slot)
implementation of the actual memory allocation is pushed down to the MemoryManager impl...
ManagerTable typeHandlers_
table of active MemoryManager instances
A special implementation of lib::Sync, where the storage of the object monitor is associated directly...
Lumiera error handling (C++ interface).
A pile of objects sharing common allocation and lifecycle.
A synchronisation protection guard employing a lock scoped to the parameter type as a whole...
void * allocation()
initiate an allocation for the given type
auto setup(FUN &&workFun)
Helper: setup a Worker-Pool configuration for the test.
"Low-level" Memory manager for allocating small objects of a fixed size.
Extension to std::unique_ptr, allowing copy operations on empty pointers (i.e.
static size_t id_
table pos+1 of the memory manager in charge for type TY
~AllocationCluster() noexcept
On shutdown of the AllocationCluster we need to assure a certain destruction order is maintained by e...
organising the association Type -> table entry
AllocationCluster()
creating a new AllocationCluster prepares a table capable of holding the individual object families t...