mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
add RocRefcounted to RocBox
This commit is contained in:
parent
386f7a6729
commit
2cd0d51409
4 changed files with 164 additions and 28 deletions
|
@ -206,7 +206,10 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: Wasm32Result> Wasm32Result for RocBox<T> {
|
||||
impl<T: Wasm32Result> Wasm32Result for RocBox<T>
|
||||
where
|
||||
T: RocRefcounted,
|
||||
{
|
||||
fn build_wrapper_body(code_builder: &mut CodeBuilder, main_function_index: u32) {
|
||||
// treat box as if it's just a isize value
|
||||
<i32 as Wasm32Result>::build_wrapper_body(code_builder, main_function_index)
|
||||
|
|
|
@ -61,7 +61,10 @@ where
|
|||
const ALIGN_OF_WASM: usize = 4;
|
||||
}
|
||||
|
||||
impl<T: Wasm32Sized> Wasm32Sized for RocBox<T> {
|
||||
impl<T: Wasm32Sized> Wasm32Sized for RocBox<T>
|
||||
where
|
||||
T: RocRefcounted,
|
||||
{
|
||||
const SIZE_OF_WASM: usize = 4;
|
||||
const ALIGN_OF_WASM: usize = 4;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue