This commit is contained in:
Simon Gardling 2023-03-25 23:48:10 -04:00
parent caba881a95
commit b9367a7de8
3 changed files with 17 additions and 17 deletions

16
Cargo.lock generated
View File

@ -586,9 +586,9 @@ dependencies = [
[[package]] [[package]]
name = "cxx" name = "cxx"
version = "1.0.93" version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9c00419335c41018365ddf7e4d5f1c12ee3659ddcf3e01974650ba1de73d038" checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93"
dependencies = [ dependencies = [
"cc", "cc",
"cxxbridge-flags", "cxxbridge-flags",
@ -598,9 +598,9 @@ dependencies = [
[[package]] [[package]]
name = "cxx-build" name = "cxx-build"
version = "1.0.93" version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb8307ad413a98fff033c8545ecf133e3257747b3bae935e7602aab8aa92d4ca" checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b"
dependencies = [ dependencies = [
"cc", "cc",
"codespan-reporting", "codespan-reporting",
@ -613,15 +613,15 @@ dependencies = [
[[package]] [[package]]
name = "cxxbridge-flags" name = "cxxbridge-flags"
version = "1.0.93" version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edc52e2eb08915cb12596d29d55f0b5384f00d697a646dbd269b6ecb0fbd9d31" checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb"
[[package]] [[package]]
name = "cxxbridge-macro" name = "cxxbridge-macro"
version = "1.0.93" version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "631569015d0d8d54e6c241733f944042623ab6df7bc3be7466874b05fcdb1c5f" checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

View File

@ -43,9 +43,9 @@ cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] { if #[cfg(target_arch = "wasm32")] {
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
use lol_alloc::{FreeListAllocator, LockedAllocator}; use lol_alloc::{FreeListAllocator, AssumeSingleThreaded};
#[global_allocator] #[global_allocator]
static ALLOCATOR: LockedAllocator<FreeListAllocator> = LockedAllocator::new(FreeListAllocator::new()); static ALLOCATOR: AssumeSingleThreaded<FreeListAllocator> = unsafe { AssumeSingleThreaded::new(FreeListAllocator::new()) };
#[wasm_bindgen(start)] #[wasm_bindgen(start)]
pub async fn start() { pub async fn start() {

View File

@ -379,16 +379,16 @@ impl MathApp {
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
{ {
tracing::info!("Saving function data"); tracing::info!("Saving function data");
let hash: crate::misc::HashBytes = unsafe { use crate::misc::{HashBytes, HashBytesHelper};
std::mem::transmute::<&str, crate::misc::HashBytes>(build::SHORT_COMMIT) let hash: HashBytes =
}; unsafe { std::mem::transmute::<&str, HashBytes>(build::SHORT_COMMIT) };
let saved_data = &crate::misc::hashed_storage_create( let saved_data = hash.hashed_storage_create(
&hash, &bincode::serialize(&self.functions)
bincode::serialize(&self.functions).unwrap().as_slice(), .expect("unable to deserialize functions"),
); );
// tracing::info!("Bytes: {}", saved_data.len()); // tracing::info!("Bytes: {}", saved_data.len());
get_localstorage() get_localstorage()
.set_item(FUNC_NAME, saved_data) .set_item(FUNC_NAME, &saved_data)
.expect("failed to set local function storage"); .expect("failed to set local function storage");
} }
} }