Move HostRef<T> into the C API crate

It isn't used by anything except for the C API and all of our embedder-exposed
APIs are already internally `Rc`-based, so it doesn't make sense to use with
them.
This commit is contained in:
Nick Fitzgerald
2020-06-01 14:48:45 -07:00
parent 8adae5d1ad
commit 58b08b9d3a
14 changed files with 124 additions and 110 deletions

View File

@@ -1,4 +1,5 @@
//! The WASI embedding API definitions for Wasmtime.
use crate::host_ref::HostRef;
use crate::{wasm_extern_t, wasm_importtype_t, wasm_store_t, wasm_trap_t, ExternHost};
use anyhow::Result;
use std::collections::HashMap;
@@ -12,7 +13,7 @@ use wasi_common::{
old::snapshot_0::WasiCtxBuilder as WasiSnapshot0CtxBuilder, preopen_dir,
WasiCtxBuilder as WasiPreview1CtxBuilder,
};
use wasmtime::{HostRef, Linker, Store, Trap};
use wasmtime::{Linker, Store, Trap};
use wasmtime_wasi::{old::snapshot_0::Wasi as WasiSnapshot0, Wasi as WasiPreview1};
unsafe fn cstr_to_path<'a>(path: *const c_char) -> Option<&'a Path> {