add RocRefcounted to RocBox

This commit is contained in:
Brendan Hansknecht 2024-07-12 23:12:42 -07:00
parent 386f7a6729
commit 2cd0d51409
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
4 changed files with 164 additions and 28 deletions

View file

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

View file

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