mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-14 23:41:30 +00:00
Initial GC integration (#196)
This commit is contained in:
@ -45,7 +45,7 @@ function instantiate(module, imports) {
|
||||
/** Allocates a new string in the module's memory and returns its pointer. */
|
||||
function newString(str) {
|
||||
var dataLength = str.length;
|
||||
var ptr = exports.allocate_memory(4 + (dataLength << 1));
|
||||
var ptr = exports["memory.allocate"](4 + (dataLength << 1));
|
||||
var dataOffset = (4 + ptr) >>> 1;
|
||||
checkMem();
|
||||
U32[ptr >>> 2] = dataLength;
|
||||
|
Reference in New Issue
Block a user