mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
only reuse call-by-pointer wrapper if same layout
This commit is contained in:
parent
24fcafa1c4
commit
447df1f0f7
1 changed files with 6 additions and 2 deletions
|
@ -5736,7 +5736,9 @@ fn call_by_pointer<'a>(
|
|||
Layout::FunctionPointer(arg_layouts, ret_layout) if !is_thunk => {
|
||||
if arg_layouts.iter().any(|l| l.contains_refcounted()) {
|
||||
if let Some(wrapper) = procs.call_by_pointer_wrappers.get(&symbol) {
|
||||
return Expr::FunctionPointer(*wrapper, layout);
|
||||
if procs.specialized.contains_key(&(*wrapper, layout.clone())) {
|
||||
return Expr::FunctionPointer(*wrapper, layout);
|
||||
}
|
||||
}
|
||||
|
||||
let name = env.unique_symbol();
|
||||
|
@ -5796,7 +5798,9 @@ fn call_by_pointer<'a>(
|
|||
Layout::FunctionPointer(arg_layouts, ret_layout) => {
|
||||
if arg_layouts.iter().any(|l| l.contains_refcounted()) {
|
||||
if let Some(wrapper) = procs.call_by_pointer_wrappers.get(&symbol) {
|
||||
return Expr::FunctionPointer(*wrapper, layout);
|
||||
if procs.specialized.contains_key(&(*wrapper, layout.clone())) {
|
||||
return Expr::FunctionPointer(*wrapper, layout);
|
||||
}
|
||||
}
|
||||
|
||||
let name = env.unique_symbol();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue