forked from Alepha/Alepha
Updated thread slab with overflow protection and rewritten.
This commit is contained in:
@ -434,6 +434,7 @@ namespace Alepha::Hydrogen ::detail:: Exception_m
|
||||
using storage_type= AllocationAmountStorage;
|
||||
virtual ~AllocationAmountInterface()= default;
|
||||
virtual std::size_t allocationAmount() const noexcept= 0;
|
||||
virtual void setAllocationAmount( std::size_t ) noexcept= 0;
|
||||
};
|
||||
class AllocationAmountStorage
|
||||
: virtual public AllocationAmountInterface
|
||||
@ -443,6 +444,8 @@ namespace Alepha::Hydrogen ::detail:: Exception_m
|
||||
|
||||
public:
|
||||
std::size_t allocationAmount() const noexcept final { return amount; }
|
||||
|
||||
void setAllocationAmount( const std::size_t amount ) noexcept { this->amount= amount; }
|
||||
};
|
||||
class AllocationException
|
||||
: virtual public create_exception< struct allocation_throwable, Exception >, virtual public AllocationAmountInterface {};
|
||||
@ -496,6 +499,7 @@ namespace Alepha::Hydrogen ::detail:: Exception_m
|
||||
class Undergird
|
||||
: virtual public Kind, virtual protected GenericExceptionBridge< std::bad_alloc >,
|
||||
virtual protected MessageStorage, virtual protected AllocationAmountStorage,
|
||||
virtual public AllocationAmountInterface,
|
||||
virtual public std::bad_alloc
|
||||
{};
|
||||
|
||||
|
Reference in New Issue
Block a user