MCPcopy Create free account
hub / github.com/GoogleChrome/samples / initMemory

Function initMemory

sqlite-wasm-cos/sqlite3-node.mjs:295–318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293// check for full engine support (use string 'subarray' to avoid closure compiler confusion)
294
295function initMemory() {
296
297
298
299 if (Module['wasmMemory']) {
300 wasmMemory = Module['wasmMemory'];
301 } else
302 {
303 var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 8388608;
304
305 /** @suppress {checkTypes} */
306 wasmMemory = new WebAssembly.Memory({
307 'initial': INITIAL_MEMORY / 65536,
308 // In theory we should not need to emit the maximum if we want "unlimited"
309 // or 4GB of memory, but VMs error on that atm, see
310 // https://github.com/emscripten-core/emscripten/issues/14130
311 // And in the pthreads case we definitely need to emit a maximum. So
312 // always emit one.
313 'maximum': 32768,
314 });
315 }
316
317 updateMemoryViews();
318}
319
320// end include: runtime_init_memory.js
321

Callers 1

sqlite3InitModuleFunction · 0.70

Calls 1

updateMemoryViewsFunction · 0.70

Tested by

no test coverage detected