more removal of roccallresult

This commit is contained in:
Folkert 2021-09-19 20:54:32 +02:00
parent cb82bcb173
commit f13e65ff8e
3 changed files with 4 additions and 14 deletions

View file

@ -4,7 +4,7 @@ use core::alloc::Layout;
use core::ffi::c_void; use core::ffi::c_void;
use core::mem::MaybeUninit; use core::mem::MaybeUninit;
use libc; use libc;
use roc_std::{RocCallResult, RocStr}; use roc_std::RocStr;
use std::ffi::CStr; use std::ffi::CStr;
use std::os::raw::c_char; use std::os::raw::c_char;
@ -93,15 +93,9 @@ unsafe fn call_the_closure(closure_data_ptr: *const u8) -> i64 {
buffer as *mut u8, buffer as *mut u8,
); );
let output = &*(buffer as *mut RocCallResult<()>); std::alloc::dealloc(buffer, layout);
match output.into() { 0
Ok(_) => {
std::alloc::dealloc(buffer, layout);
0
}
Err(e) => panic!("failed with {}", e),
}
} }
#[no_mangle] #[no_mangle]

View file

@ -56,8 +56,6 @@ const Allocator = mem.Allocator;
extern fn roc__mainForHost_1_exposed(*RocStr) void; extern fn roc__mainForHost_1_exposed(*RocStr) void;
const RocCallResult = extern struct { flag: u64, content: RocStr };
const Unit = extern struct {}; const Unit = extern struct {};
pub fn main() u8 { pub fn main() u8 {

View file

@ -1,3 +1 @@
const RocCallResult = extern struct { flag: usize, content: u64 }; export fn roc__mainForHost_1_exposed(_i: i64, _result: *u64) void {}
export fn roc__mainForHost_1_exposed(_i: i64, _result: *RocCallResult) void{}