mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-10 10:02:38 +03:00
pass by pointer more on windows
This commit is contained in:
parent
bfc00a4b94
commit
f0f720a86a
@ -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…
Reference in New Issue
Block a user