From 851a02cd69c84884df176a1347a44f51b3421f8f Mon Sep 17 00:00:00 2001 From: Maximilian Ammann Date: Thu, 15 Sep 2022 16:57:32 +0200 Subject: [PATCH] Remove maximum memory limits --- web/lib/src/unsync/index.ts | 3 +-- web/lib/src/unsync/pool.worker.ts | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/web/lib/src/unsync/index.ts b/web/lib/src/unsync/index.ts index 13e1f06d..55144e8e 100644 --- a/web/lib/src/unsync/index.ts +++ b/web/lib/src/unsync/index.ts @@ -22,8 +22,7 @@ export const startMapLibre = async (wasmPath: string | undefined, workerPath: st } preventDefaultTouchActions(); - let MEMORY_PAGES = 16 * 1024 - const memory = new WebAssembly.Memory({initial: 1024, maximum: MEMORY_PAGES, shared: false}) + const memory = new WebAssembly.Memory({initial: 1024, shared: false}) await init(wasmPath, memory); let callback = [undefined] diff --git a/web/lib/src/unsync/pool.worker.ts b/web/lib/src/unsync/pool.worker.ts index 05417b88..4af245c3 100644 --- a/web/lib/src/unsync/pool.worker.ts +++ b/web/lib/src/unsync/pool.worker.ts @@ -1,9 +1,9 @@ import init, {unsync_worker_entry} from "../wasm/maplibre" onmessage = async message => { - let MEMORY_PAGES = 16 * 1024 - const memory = new WebAssembly.Memory({initial: 1024, maximum: MEMORY_PAGES, shared: false}) - const initialised = init(message.data[0], memory).catch(err => { + const memory = new WebAssembly.Memory({initial: 1024, shared: false}) + let module = message.data[0]; + const initialised = init(module, memory).catch(err => { // Propagate to main `onerror`: setTimeout(() => { throw err;