forked from Alepha/Alepha
Start moving towards the alignment solution>
Some of this needs to be branched out.
This commit is contained in:
@ -58,15 +58,15 @@ namespace Alepha::Hydrogen::Memory ::detail:: ThreadSlab_m
|
||||
{
|
||||
// TODO: Alignment?
|
||||
const std::size_t req= amt + sizeof( Blob::StorageReservation );
|
||||
if( req > C::slabSize ) throw std::bad_alloc{}; //{ "Unable to allocate larger than the slab size." };
|
||||
if( slab.size() < req ) slab.reset( std::max( req, C::slabSize ) );
|
||||
|
||||
std::cerr << "Reporting " << slab.reservation().use_count() << " living allocations when "
|
||||
<< (void *) this << " made an allocation." << std::endl;
|
||||
|
||||
auto next= slab.carveHead( req );
|
||||
new ( &next.template as< Blob::StorageReservation >() ) Blob::StorageReservation{ next.reservation() };
|
||||
auto next= slab.carveHead( req, Alignment{ sizeof( Blob::StorageReservation ) } );
|
||||
const auto rv= reinterpret_cast< T * >( &next.template as< Blob::StorageReservation >() + 1 );
|
||||
next.reset();
|
||||
new ( &next.template as< Blob::StorageReservation >() ) Blob::StorageReservation{ std::move( next.reservation() ) };
|
||||
|
||||
std::cerr << "Reporting " << slab.reservation().use_count() << " living allocations when "
|
||||
<< (void *) this << " made an allocation." << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user