hyperdb-wasm 0.0.26774-dev.wasm.g364818c4 → 0.0.26776-dev.wasm.ge19fa803
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser_worker.js
CHANGED
|
@@ -229,8 +229,10 @@
|
|
|
229
229
|
function allocate(module, bytes) {
|
|
230
230
|
const pointer = safePointer(module._malloc(bytes.byteLength || 1), "allocation pointer");
|
|
231
231
|
if (pointer === 0) throw new Error("wasm allocation failed");
|
|
232
|
-
|
|
233
|
-
module.HEAPU8
|
|
232
|
+
module.getValue(pointer, "i8");
|
|
233
|
+
const heap = module.HEAPU8;
|
|
234
|
+
if (pointer + bytes.byteLength > heap.byteLength) throw new Error("allocation exceeds the wasm heap");
|
|
235
|
+
heap.set(bytes, pointer);
|
|
234
236
|
return pointer;
|
|
235
237
|
}
|
|
236
238
|
function installHttpRuntime(module, transport) {
|
|
Binary file
|
package/dist/node_worker.js
CHANGED
|
@@ -236,8 +236,10 @@ function safePointer(value, name) {
|
|
|
236
236
|
function allocate(module2, bytes) {
|
|
237
237
|
const pointer = safePointer(module2._malloc(bytes.byteLength || 1), "allocation pointer");
|
|
238
238
|
if (pointer === 0) throw new Error("wasm allocation failed");
|
|
239
|
-
|
|
240
|
-
module2.HEAPU8
|
|
239
|
+
module2.getValue(pointer, "i8");
|
|
240
|
+
const heap = module2.HEAPU8;
|
|
241
|
+
if (pointer + bytes.byteLength > heap.byteLength) throw new Error("allocation exceeds the wasm heap");
|
|
242
|
+
heap.set(bytes, pointer);
|
|
241
243
|
return pointer;
|
|
242
244
|
}
|
|
243
245
|
function installHttpRuntime(module2, transport2) {
|