pass by pointer more on windows

This commit is contained in:
Folkert 2022-09-01 20:12:55 +02:00
parent bfc00a4b94
commit f0f720a86a
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C

View File

@ -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