Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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

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

Member Typedef Documentation

◆ Allo

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

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

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

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

References AllocationCluster_test::checkLifecycle(), AllocationCluster_test::dynamicAdjustment(), AllocationCluster_test::simpleUsage(), AllocationCluster_test::use_as_Allocator(), and AllocationCluster_test::verifyInternals().

+ Here is the call graph for this function:

◆ simpleUsage()

void simpleUsage ( )
inlineprivate

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

References AllocationCluster::create(), and AllocationCluster::numExtents().

Referenced by AllocationCluster_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

References AllocationCluster::createDisposable(), and AllocationCluster::numExtents().

Referenced by AllocationCluster_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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::create(), AllocationCluster::createDisposable(), AllocationCluster::numBytes(), AllocationCluster::numExtents(), AllocationCluster::Storage::pos, lib::test::randStr(), lib::rani(), AllocationCluster::Storage::rest, and AllocationCluster::storage_.

Referenced by AllocationCluster_test::run().

+ Here is the call graph for this function:
+ Here is the caller 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 lib::explore(), AllocationCluster::getAllocator(), MAX, and AllocationCluster::numExtents().

Referenced by AllocationCluster_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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::canAdjust(), AllocationCluster::create(), AllocationCluster::doAdjust(), LERR_, AllocationCluster::numBytes(), AllocationCluster::numExtents(), and VERIFY_ERROR.

Referenced by AllocationCluster_test::run().

+ Here is the call graph for this function:
+ Here is the caller 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: