Skip to content

Commit d7299ba

Browse files
committed
Remove the Rcs around the WASM global HashMaps
1 parent 8dcea92 commit d7299ba

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

wasm/lib/src/convert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn py_err_to_js_err(vm: &mut VirtualMachine, py_err: &PyObjectRef) -> JsValu
4747
.ok()
4848
.and_then(|lineno| lineno.to_u32())
4949
{
50-
Reflect::set(&js_err, &"row".into(), &lineno.into());
50+
let _ = Reflect::set(&js_err, &"row".into(), &lineno.into());
5151
}
5252
}
5353
}

wasm/lib/src/vm_class.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ impl StoredVirtualMachine {
4141
}
4242
}
4343

44-
// It's fine that it's thread local, since WASM doesn't even have threads yet. thread_local! probably
45-
// gets compiled down to a normal-ish static varible, like Atomic* types:
44+
// It's fine that it's thread local, since WASM doesn't even have threads yet. thread_local!
45+
// probably gets compiled down to a normal-ish static varible, like Atomic* types do:
4646
// https://rustwasm.github.io/2018/10/24/multithreading-rust-and-wasm.html#atomic-instructions
4747
thread_local! {
48-
static STORED_VMS: Rc<RefCell<HashMap<String, Rc<RefCell<StoredVirtualMachine>>>>> = Rc::default();
49-
static ACTIVE_VMS: Rc<RefCell<HashMap<String, *mut VirtualMachine>>> = Rc::default();
48+
static STORED_VMS: RefCell<HashMap<String, Rc<RefCell<StoredVirtualMachine>>>> =
49+
RefCell::default();
50+
static ACTIVE_VMS: RefCell<HashMap<String, *mut VirtualMachine>> = RefCell::default();
5051
}
5152

5253
#[wasm_bindgen(js_name = vmStore)]

0 commit comments

Comments
 (0)