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 c77ffd9 commit 7b3dbe8Copy full SHA for 7b3dbe8
grower-js/src/jsni.ts
@@ -177,10 +177,9 @@ class JSNIFunctionCallingSession {
177
break;
178
case "string":
179
const strBytes = new TextEncoder().encode(values[i]);
180
- const strFatPtr = this.imports.alloc(strBytes.length + 1); // 1 byte for null terminator
+ const strFatPtr = this.imports.alloc(strBytes.length);
181
const strPtr = Number(strFatPtr & BigInt(0xffffffff));
182
this.arr.set(strBytes, strPtr);
183
- this.arr[strPtr + strBytes.length] = 0; // null terminator
184
this.view.setUint32(ptr + i * 16, Number(strFatPtr >> BigInt(32)), true);
185
this.view.setInt32(ptr + i * 16 + 8, JSNIKind.String, true);
186
0 commit comments