xo-alloc: streamlining DArena allocation: + construct_with() helper

This commit is contained in:
Roland Conybeare 2025-12-18 19:41:47 -05:00
commit 1ec9759f19
5 changed files with 53 additions and 42 deletions

View file

@ -290,6 +290,30 @@ namespace xo {
return DArenaIterator::end(this);
}
AllocHeader *
DArena::begin_header() const noexcept
{
if (config_.store_header_flag_ == false) {
this->capture_error(error::alloc_iterator_not_supported);
return nullptr;
}
return (AllocHeader *)lo_;
}
AllocHeader *
DArena::end_header() const noexcept
{
if (config_.store_header_flag_ == false) {
this->capture_error(error::alloc_iterator_not_supported);
return nullptr;
}
return (AllocHeader *)free_;
}
std::byte *
DArena::alloc(std::size_t req_z)
{