1
0
forked from Alepha/Alepha

Updated thread slab with overflow protection and rewritten.

This commit is contained in:
2024-09-06 17:06:08 -04:00
parent 9717ae49a4
commit 5efc8b79f0
5 changed files with 153 additions and 77 deletions

View File

@ -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
{};