xo-alloc: streamlining DArena allocation: + construct_with() helper
This commit is contained in:
parent
f9cc86e4a5
commit
1ec9759f19
5 changed files with 53 additions and 42 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue