mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
pass by pointer more on windows
This commit is contained in:
parent
bfc00a4b94
commit
f0f720a86a
1 changed files with 5 additions and 1 deletions
|
@ -6686,7 +6686,11 @@ impl<'ctx> FunctionSpec<'ctx> {
|
|||
/// According to the C ABI, how should we return a value with the given layout?
|
||||
pub fn to_cc_return<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>, layout: &Layout<'a>) -> CCReturn {
|
||||
let return_size = layout.stack_size(env.target_info);
|
||||
let pass_result_by_pointer = return_size > 2 * env.target_info.ptr_width() as u32;
|
||||
let pass_result_by_pointer = match env.target_info.operating_system {
|
||||
roc_target::OperatingSystem::Windows => return_size >= env.target_info.ptr_width() as u32,
|
||||
roc_target::OperatingSystem::Unix => return_size > 2 * env.target_info.ptr_width() as u32,
|
||||
roc_target::OperatingSystem::Wasi => unreachable!(),
|
||||
};
|
||||
|
||||
if return_size == 0 {
|
||||
CCReturn::Void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue