mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
make deep_copy_var use scratchpad arena
This commit is contained in:
parent
2d0d54e13e
commit
471593ea31
1 changed files with 5 additions and 1 deletions
|
@ -1653,7 +1653,8 @@ fn instantiate_rigids_help(subs: &mut Subs, max_rank: Rank, initial: Variable) {
|
|||
}
|
||||
|
||||
fn deep_copy_var(subs: &mut Subs, rank: Rank, pools: &mut Pools, var: Variable) -> Variable {
|
||||
let arena = bumpalo::Bump::with_capacity(4 * 1024);
|
||||
let mut arena = take_scratchpad();
|
||||
|
||||
let mut visited = bumpalo::collections::Vec::with_capacity_in(4 * 1024, &arena);
|
||||
|
||||
let copy = deep_copy_var_help(subs, rank, pools, &mut visited, var);
|
||||
|
@ -1670,6 +1671,9 @@ fn deep_copy_var(subs: &mut Subs, rank: Rank, pools: &mut Pools, var: Variable)
|
|||
}
|
||||
}
|
||||
|
||||
arena.reset();
|
||||
put_scratchpad(arena);
|
||||
|
||||
copy
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue