This repository was archived by the owner on Jun 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 11const gulp = require ( "gulp" ) ;
2+ /*
3+ Runtime variants:
24
5+ "--runtime", "full" (default)
6+ A proper memory manager and reference-counting based garbage collector, with runtime interfaces
7+ being exported to the host for being able to create managed objects externally.
8+
9+ "--runtime", "half"
10+ The same as full but without any exports, i.e. where creating objects externally is not required.
11+ This allows the optimizer to eliminate parts of the runtime that are not needed.
12+
13+ "--runtime", "stub"
14+ A minimalist arena memory manager without any means of freeing up memory again, but the same external
15+ interface as full. Useful for very short-lived programs or programs with hardly any memory footprint,
16+ while keeping the option to switch to full without any further changes. No garbage collection.
17+
18+ "--runtime", "none"
19+ The same as stub but without any exports, for the same reasons as explained in half. Essentially
20+ evaporates entirely after optimizations.
21+
22+ For more information see: https://docs.assemblyscript.org/details/runtime
23+ */
324gulp . task ( "build" , callback => {
425 const asc = require ( "assemblyscript/bin/asc" ) ;
526 asc . main ( [
627 "main.ts" ,
728 "--baseDir" , "assembly" ,
829 "--binaryFile" , "../out/main.wasm" ,
930 "--sourceMap" ,
10- "--measure"
31+ "--measure" ,
32+ "--runtime" , "half" ,
33+ "--optimize"
1134 ] , callback ) ;
1235} ) ;
1336
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ WebAssembly.instantiateStreaming(fetch("../out/main.wasm"), {
55 }
66 } ,
77 env : {
8- abort ( msg , file , line , column ) {
8+ abort ( _msg , _file , line , column ) {
99 console . error ( "abort called at main.ts:" + line + ":" + column ) ;
1010 }
1111 } ,
You can’t perform that action at this time.
0 commit comments