Implement struct-by-reference for structs over 4 machine words

This commit is contained in:
Ayaz Hafiz 2023-06-12 16:39:20 -05:00
parent e1c874ac23
commit 47fb9fe6f2
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
5 changed files with 83 additions and 23 deletions

View file

@ -67,6 +67,11 @@ impl TargetInfo {
}
}
pub const fn max_by_value_size(&self) -> usize {
// Pass values larger than 4 machine words by reference.
self.ptr_size() * 4
}
pub const fn ptr_alignment_bytes(&self) -> usize {
self.architecture.ptr_alignment_bytes()
}