Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
AllocatorHandle< TY > Class Template Reference

#include "lib/allocator-handle.hpp"

Description

template<typename TY>
class lib::AllocatorHandle< TY >

Placeholder implementation for a custom allocator.

Todo:

shall be replaced by an AllocationCluster eventually

5/2024 to be reworked and aligned with a prospective C++20 Allocator Concept /////////////////////TICKET #1366

Remarks
using std::list container, since re-entrant allocation calls are possible, meaning that further allocations will be requested recursively from a ctor. Moreover, for the same reason we separate the allocation from the ctor call, so we can capture the address of the new allocation prior to any possible re-entrant call, and handle clean-up of allocation without requiring any additional state flags.....

Definition at line 296 of file allocator-handle.hpp.

Classes

struct  Allocation
 

Public Member Functions

template<typename... ARGS>
TY & operator() (ARGS &&...args)
 
 ~AllocatorHandle ()
 

Private Attributes

std::list< Allocationstorage_
 

Constructor & Destructor Documentation

◆ ~AllocatorHandle()

template<typename TY >
~AllocatorHandle ( )
inline
Note
need to do explicit clean-up, since a ctor-call might have been failed, and we have no simple way to record this fact internally in Allocation, short of wasting additional memory for a flag to mark this situation

Definition at line 347 of file allocator-handle.hpp.

References AllocatorHandle< TY >::storage_.

Member Function Documentation

◆ operator()()

template<typename TY >
template<typename... ARGS>
TY & operator() ( ARGS &&...  args)
inline

Definition at line 327 of file allocator-handle.hpp.

References lumiera_error(), and AllocatorHandle< TY >::storage_.

+ Here is the call graph for this function:

Member Data Documentation

◆ storage_

template<typename TY >
std::list<Allocation> storage_
private
+ Inheritance diagram for AllocatorHandle< TY >:
+ Collaboration diagram for AllocatorHandle< TY >:

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