@@ -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, 4 ) >>> 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, 4 ) >>> 0;
1270
1270
1271
1271
const mem = {mem}();
1272
1272
@@ -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]);
@@ -1415,8 +1415,8 @@ impl<'a> Context<'a> {
1415
1415
self . expose_wasm_vector_len ( ) ;
1416
1416
self . global ( & format ! (
1417
1417
"
1418
- function {}(arg, malloc) {{
1419
- const ptr = malloc(arg.length * {size}) >>> 0;
1418
+ function {}(arg, malloc, align ) {{
1419
+ const ptr = malloc(arg.length * {size}, align ) >>> 0;
1420
1420
{}().set(arg, ptr / {size});
1421
1421
WASM_VECTOR_LEN = arg.length;
1422
1422
return ptr;
0 commit comments