Lumiera  0.pre.03
»edit your freedom«
AllocationCluster_test Class Reference

Description

Test:
verify the proper workings of our custom allocation scheme managing families of interconnected objects for the segments of the low-level model.

Definition at line 139 of file allocation-cluster-test.cpp.

Private Types

template<typename X >
using Allo = AllocationCluster::Allocator< X >
 

Private Member Functions

void checkLifecycle ()
 
void dynamicAdjustment ()
 
virtual void run (Arg)
 
void simpleUsage ()
 
void use_as_Allocator ()
 
void verifyInternals ()
 

Member Function Documentation

◆ checkLifecycle()

void checkLifecycle ( )
inlineprivate
Test:
Allocation cluster grows when adding objects, but discards all objects at once when going out of scope, optionally also invoking (or not invoking) destructors.
Remarks
no destructors are invoked for any objects allocated through the createDisposable<TY>(args...) interface, or for allocations though the standard allocator adapter.

Definition at line 184 of file allocation-cluster-test.cpp.

◆ verifyInternals()

void verifyInternals ( )
inlineprivate
Test:
cover some tricky aspects of the low-level allocator
Remarks
due to the expected leverage of AllocationCluster, an optimised low-level approach was taken on various aspects of storage management; the additional metadata overhead is a power of two, exploiting contextual knowledge about layout; moreover, a special usage-mode allows to skip invocation of destructors. To document these machinations, change to internal data is explicitly verified here.

Definition at line 219 of file allocation-cluster-test.cpp.

References AllocationCluster::numBytes(), and lib::rani().

+ Here is the call graph for this function:

◆ use_as_Allocator()

void use_as_Allocator ( )
inlineprivate
Test:
demonstrate use as Standard-Allocator
  • define a vector, string and set to use the AllocationCluster as backend
  • fill the vector with numbers and the set with random strings
Note
the extent size (hard coded as of 5/24) imposes a serious limitation regarding usable data structures; e.g. the std::deque immediately attempts to allocate a node buffer with >500 bytes, which is not supported by the current (rather simplistic) storage manager in AllocationCluster.

Definition at line 384 of file allocation-cluster-test.cpp.

References MAX.

◆ dynamicAdjustment()

void dynamicAdjustment ( )
inlineprivate
Test:
verify the ability to adjust the latest allocation dynamically.

Definition at line 422 of file allocation-cluster-test.cpp.

References AllocationCluster::numBytes().

+ Here is the call graph for this function:
+ Inheritance diagram for AllocationCluster_test:
+ Collaboration diagram for AllocationCluster_test:

The documentation for this class was generated from the following file: