xo-alloc2: + Allocator::alloc_info()

Also extend unit test
This commit is contained in:
Roland Conybeare 2025-12-16 16:44:44 -05:00
commit ef8ec32a2d
15 changed files with 156 additions and 40 deletions

View file

@ -239,6 +239,24 @@ namespace xo {
return false;
}
AllocInfo
DX1Collector::alloc_info(value_type mem) noexcept {
for (role ri : role::all()) {
for (generation gj{0}; gj < config_.n_generation_; ++gj) {
DArena * arena = this->get_space(ri, gj);
assert(arena);
if (arena->contains(mem)) {
return arena->alloc_info(mem);
}
}
}
// deliberately attempt on nursery to-space, to capture error info + return sentinel
return this->new_space()->alloc_info(mem);
}
void
DX1Collector::reverse_roles(generation g) noexcept {
assert(g < config_.n_generation_);