@@ -1259,14 +1259,14 @@ impl<'a> Context<'a> {
1259
1259
"\
1260
1260
if (realloc === undefined) {{
1261
1261
const buf = cachedTextEncoder.encode(arg);
1262
- const ptr = malloc(buf.length) >>> 0;
1262
+ const ptr = malloc(buf.length, 1 ) >>> 0;
1263
1263
{mem}().subarray(ptr, ptr + buf.length).set(buf);
1264
1264
WASM_VECTOR_LEN = buf.length;
1265
1265
return ptr;
1266
1266
}}
1267
1267
1268
1268
let len = arg.length;
1269
- let ptr = malloc(len) >>> 0;
1269
+ let ptr = malloc(len, 1 ) >>> 0;
1270
1270
1271
1271
const mem = {mem}();
1272
1272
@@ -1294,7 +1294,7 @@ impl<'a> Context<'a> {
1294
1294
if (offset !== 0) {{
1295
1295
arg = arg.slice(offset);
1296
1296
}}
1297
- ptr = realloc(ptr, len, len = offset + arg.length * 3) >>> 0;
1297
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1 ) >>> 0;
1298
1298
const view = {mem}().subarray(ptr + offset, ptr + len);
1299
1299
const ret = encodeString(arg, view);
1300
1300
{debug_end}
@@ -1366,7 +1366,7 @@ impl<'a> Context<'a> {
1366
1366
self . global ( & format ! (
1367
1367
"
1368
1368
function {}(array, malloc) {{
1369
- const ptr = malloc(array.length * 4) >>> 0;
1369
+ const ptr = malloc(array.length * 4, 4 ) >>> 0;
1370
1370
const mem = {}();
1371
1371
for (let i = 0; i < array.length; i++) {{
1372
1372
mem[ptr / 4 + i] = {}(array[i]);
@@ -1383,7 +1383,7 @@ impl<'a> Context<'a> {
1383
1383
self . global ( & format ! (
1384
1384
"
1385
1385
function {}(array, malloc) {{
1386
- const ptr = malloc(array.length * 4) >>> 0;
1386
+ const ptr = malloc(array.length * 4, 4 ) >>> 0;
1387
1387
const mem = {}();
1388
1388
for (let i = 0; i < array.length; i++) {{
1389
1389
mem[ptr / 4 + i] = addHeapObject(array[i]);
@@ -1416,7 +1416,7 @@ impl<'a> Context<'a> {
1416
1416
self . global ( & format ! (
1417
1417
"
1418
1418
function {}(arg, malloc) {{
1419
- const ptr = malloc(arg.length * {size}) >>> 0;
1419
+ const ptr = malloc(arg.length * {size}, {size} ) >>> 0;
1420
1420
{}().set(arg, ptr / {size});
1421
1421
WASM_VECTOR_LEN = arg.length;
1422
1422
return ptr;
0 commit comments