Remove no-longer-necessary ReferenceCount uses in wasm

This commit is contained in:
Richard Feldman 2022-05-26 11:18:06 -04:00
parent d9b8cec74d
commit 1ef5d785c0
No known key found for this signature in database
GPG Key ID: 7E4127D1E4241798
3 changed files with 5 additions and 6 deletions

View File

@ -7,7 +7,6 @@ The user needs to analyse the Wasm module's memory to decode the result.
use bumpalo::{collections::Vec, Bump};
use roc_builtins::bitcode::{FloatWidth, IntWidth};
use roc_mono::layout::{Builtin, Layout, UnionLayout};
use roc_std::ReferenceCount;
use roc_target::TargetInfo;
use crate::wasm32_sized::Wasm32Sized;
@ -197,7 +196,7 @@ impl Wasm32Result for RocStr {
}
}
impl<T: Wasm32Result + ReferenceCount> Wasm32Result for RocList<T> {
impl<T: Wasm32Result> Wasm32Result for RocList<T> {
fn build_wrapper_body(code_builder: &mut CodeBuilder, main_function_index: u32) {
build_wrapper_body_stack_memory(code_builder, main_function_index, 12)
}

View File

@ -1,4 +1,4 @@
use roc_std::{ReferenceCount, RocDec, RocList, RocOrder, RocStr};
use roc_std::{RocDec, RocList, RocOrder, RocStr};
pub trait Wasm32Sized: Sized {
const SIZE_OF_WASM: usize;
@ -35,7 +35,7 @@ impl Wasm32Sized for RocStr {
const ALIGN_OF_WASM: usize = 4;
}
impl<T: Wasm32Sized + ReferenceCount> Wasm32Sized for RocList<T> {
impl<T: Wasm32Sized> Wasm32Sized for RocList<T> {
const SIZE_OF_WASM: usize = 12;
const ALIGN_OF_WASM: usize = 4;
}

View File

@ -1,5 +1,5 @@
use roc_gen_wasm::wasm32_sized::Wasm32Sized;
use roc_std::{ReferenceCount, RocDec, RocList, RocOrder, RocStr};
use roc_std::{RocDec, RocList, RocOrder, RocStr};
use std::convert::TryInto;
pub trait FromWasmerMemory: Wasm32Sized {
@ -74,7 +74,7 @@ impl FromWasmerMemory for RocStr {
}
}
impl<T: FromWasmerMemory + Clone + ReferenceCount> FromWasmerMemory for RocList<T> {
impl<T: FromWasmerMemory + Clone> FromWasmerMemory for RocList<T> {
fn decode(memory: &wasmer::Memory, offset: u32) -> Self {
let bytes = <u64 as FromWasmerMemory>::decode(memory, offset);