mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Boxed
This commit is contained in:
parent
d4379ff895
commit
a0f8b50efe
1 changed files with 28 additions and 0 deletions
|
@ -380,6 +380,34 @@ fn specialize_drops_stmt<'a, 'i>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Layout::Boxed(_layout) => {
|
||||||
|
let removed = match incremented_children.iter().next() {
|
||||||
|
Some(s) => incremented_children.remove(&s.clone()),
|
||||||
|
None => false,
|
||||||
|
};
|
||||||
|
|
||||||
|
let new_continuation = specialize_drops_stmt(
|
||||||
|
arena,
|
||||||
|
layout_interner,
|
||||||
|
ident_ids,
|
||||||
|
environment,
|
||||||
|
continuation,
|
||||||
|
);
|
||||||
|
|
||||||
|
if removed {
|
||||||
|
// No need to decrement the containing value since we already decremented the child.
|
||||||
|
arena.alloc(Stmt::Refcounting(
|
||||||
|
ModifyRc::DecRef(*symbol),
|
||||||
|
new_continuation,
|
||||||
|
))
|
||||||
|
} else {
|
||||||
|
// No known children, keep decrementing the symbol.
|
||||||
|
arena.alloc(Stmt::Refcounting(
|
||||||
|
ModifyRc::Dec(*symbol),
|
||||||
|
new_continuation,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
// TODO: Implement this with uniqueness checks.
|
// TODO: Implement this with uniqueness checks.
|
||||||
_ => {
|
_ => {
|
||||||
let new_continuation = specialize_drops_stmt(
|
let new_continuation = specialize_drops_stmt(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue