wasmtime-wiggle: take an Rc<RefCell<ctx>> instead of construct one

so that if users wish to share a ctx between modules they may!
This commit is contained in:
Pat Hickey
2021-01-29 12:18:21 -08:00
parent c8e76b11ba
commit 70f8288ec9

View File

@@ -122,8 +122,7 @@ contained in the `cx` parameter.",
impl #type_name {
#[doc = #constructor_docs]
pub fn new(store: &wasmtime::Store, cx: #ctx_type) -> Self {
let cx = std::rc::Rc::new(std::cell::RefCell::new(cx));
pub fn new(store: &wasmtime::Store, cx: std::rc::Rc<std::cell::RefCell<#ctx_type>>) -> Self {
#(#ctor_externs)*
Self {