xo-gc: move DX1Collector.generation_of() impl -> GCObjectStore

This commit is contained in:
Roland Conybeare 2026-04-02 20:28:07 -04:00
commit 57b6d2380b
3 changed files with 19 additions and 8 deletions

View file

@ -62,6 +62,19 @@ namespace xo {
}
}
Generation
GCObjectStore::generation_of(role r, const void * addr) const noexcept
{
for (Generation gi{0}; gi < n_generation_; ++gi) {
const DArena * arena = this->get_space(r, gi);
if (arena->contains(addr))
return gi;
}
return Generation::sentinel();
}
void
GCObjectStore::visit_pools(const MemorySizeVisitor & visitor) const
{