Add importMemory option to asc, see #36

This commit is contained in:
dcodeIO
2018-02-28 18:38:42 +01:00
parent 56bc1be8ba
commit 02dce5a518
12 changed files with 158 additions and 70 deletions

View File

@ -277,6 +277,7 @@ exports.main = function main(argv, options, callback) {
assemblyscript.setNoTreeShaking(compilerOptions, !!args.noTreeShaking);
assemblyscript.setNoAssert(compilerOptions, !!args.noAssert);
assemblyscript.setNoMemory(compilerOptions, !!args.noMemory);
assemblyscript.setImportMemory(compilerOptions, !!args.importMemory);
assemblyscript.setMemoryBase(compilerOptions, args.memoryBase >>> 0);
assemblyscript.setSourceMap(compilerOptions, args.sourceMap != null);

View File

@ -89,6 +89,10 @@
"desc": "Does not set up a memory. Useful for low-level WebAssembly.",
"type": "boolean"
},
"importMemory": {
"desc": "Imports the memory instance provided by the embedder.",
"type": "boolean"
},
"memoryBase": {
"desc": "Sets the start offset of compiler-generated static memory.",
"type": "number"