We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d6fae8 commit 914c241Copy full SHA for 914c241
src/utils/parseArgs.js
@@ -1,8 +1,9 @@
1
module.exports = (Core, args) => {
2
const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);
3
args.forEach((s, idx) => {
4
- const buf = Core._malloc(s.length + 1);
5
- Core.writeAsciiToMemory(s, buf);
+ const sz = s.length*4 + 1;
+ const buf = Core._malloc(sz);
6
+ Core.stringToUTF8(s, buf, sz);
7
Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');
8
});
9
return [args.length, argsPtr];
0 commit comments