refactor: + narrower interface for gc pointer forwarding
add AGCObjectVisitor, instead of requiring ACollector.
This commit is contained in:
parent
c3af763383
commit
fdc3054c7c
46 changed files with 187 additions and 165 deletions
|
|
@ -94,26 +94,27 @@ namespace xo {
|
|||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
DIfElseExpr::forward_children(obj<ACollector> gc) noexcept
|
||||
void
|
||||
DIfElseExpr::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
typeref_.forward_children(gc);
|
||||
typeref_.visit_gco_children(gc);
|
||||
|
||||
// GC needs to locate AGCObject iface for each member.
|
||||
{
|
||||
auto gco = test_.to_facet<AGCObject>();
|
||||
gc.forward_inplace(gco.iface(), (void **)&(test_.data_));
|
||||
gc.visit_poly_child(&test_);
|
||||
//auto gco = test_.to_facet<AGCObject>();
|
||||
//gc.forward_inplace(gco.iface(), (void **)&(test_.data_));
|
||||
}
|
||||
{
|
||||
auto gco = when_true_.to_facet<AGCObject>();
|
||||
gc.forward_inplace(gco.iface(), (void **)&(when_true_.data_));
|
||||
gc.visit_poly_child(&when_true_);
|
||||
//auto gco = when_true_.to_facet<AGCObject>();
|
||||
//gc.forward_inplace(gco.iface(), (void **)&(when_true_.data_));
|
||||
}
|
||||
{
|
||||
auto gco = when_false_.to_facet<AGCObject>();
|
||||
gc.forward_inplace(gco.iface(), (void **)&(when_false_.data_));
|
||||
gc.visit_poly_child(&when_false_);
|
||||
//auto gco = when_false_.to_facet<AGCObject>();
|
||||
//gc.forward_inplace(gco.iface(), (void **)&(when_false_.data_));
|
||||
}
|
||||
|
||||
return shallow_size();
|
||||
}
|
||||
|
||||
// ----- printable facet -----
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue