xo-gc: + Collector.is_type_installed()

This commit is contained in:
Roland Conybeare 2026-01-02 22:33:54 -05:00
commit 44a096c6f7
9 changed files with 68 additions and 1 deletions

View file

@ -198,6 +198,19 @@ namespace xo {
return config_.arena_config_.header_.is_forwarding_tseq(hdr);
}
bool
DX1Collector::is_type_installed(typeseq tseq) const noexcept
{
if (object_types_.committed() < sizeof(AGCObject) * (tseq.seqno() + 1))
return false;
AGCObject * v = reinterpret_cast<AGCObject *>(object_types_.lo_);
void * vtable = *(void **)&(v[tseq.seqno()]);
return (vtable != nullptr);
}
bool
DX1Collector::install_type(const AGCObject & meta) noexcept
{