mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Add rationale for passing values by reference
This commit is contained in:
parent
0f327d9f38
commit
9ecb1bbd73
1 changed files with 3 additions and 0 deletions
|
@ -69,6 +69,9 @@ impl TargetInfo {
|
|||
|
||||
pub const fn max_by_value_size(&self) -> usize {
|
||||
// Pass values larger than 4 machine words by reference.
|
||||
// This is a reasonable default for most architectures. We want to pass large values by
|
||||
// reference because it's more efficient than copying them around on the stack, and puts
|
||||
// less pressure on CPU registers.
|
||||
self.ptr_size() * 4
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue