You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some cases where we want to create the memory in JS but for
most programs exporting the memory from wasm makes more sense and is
more compact and reliable.
The new EXTERNAL_MEMORY setting can be used to override this behaviour.
assert(bufferinstanceofSharedArrayBuffer,'requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag');
85
-
#endif
86
-
#endif
87
-
88
-
#if ASSERTIONS
89
-
#if USE_PTHREADS
90
-
if(!ENVIRONMENT_IS_PTHREAD){
91
-
#endif
92
-
assert(buffer.byteLength==={{{INITIAL_MEMORY}}});
93
-
#if USE_PTHREADS
94
-
}
95
-
#endif
96
-
#endif // ASSERTIONS
97
-
98
-
#if ALLOW_MEMORY_GROWTH
99
-
// In ALLOW_MEMORY_GROWTH, we need to be able to re-initialize the
100
-
// typed array buffer and heap views to the buffer whenever the heap
assert(binstanceofSharedArrayBuffer,'requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag');
64
+
#endif
104
65
buffer=b;
105
66
HEAP8=newInt8Array(b);
106
67
HEAP16=newInt16Array(b);
@@ -111,34 +72,33 @@ function updateGlobalBufferAndViews(b) {
111
72
HEAPF32=newFloat32Array(b);
112
73
HEAPF64=newFloat64Array(b);
113
74
}
114
-
updateGlobalBufferAndViews(buffer);
115
-
#else
116
-
// In non-ALLOW_MEMORY_GROWTH scenario, we only need to initialize
117
-
// the heap once, so optimize code size to do it statically here.
0 commit comments