runtime integration and flag

This commit is contained in:
dcode
2019-03-31 21:58:42 +02:00
parent c4a57025d2
commit 27f1905510
225 changed files with 8010 additions and 9365 deletions

38
std/runtime/README.md Normal file
View File

@ -0,0 +1,38 @@
AssemblyScript runtimes
=======================
Default
-------
```
$> asc ...
```
The [default runtime](./default.ts) adds proper support for dynamic memory management and garbage collection to your program.
* [TLSF memory allocator](../assembly/allocator/tlsf.ts)
* [ITCM garbage collector](../assembly/collector/itcm.ts)
Arena
-----
```
$> asc ... --runtime arena
```
The [arena runtime](./arena.ts) is just enough to make most language features work, but doesn't have sophisticated support for freeing memory. Useful when prototyping or for simple one-shot modules in that it produces very small modules with minimal overhead.
* [Arena memory allocator](../assembly/allocator/arena.ts) with `memory.reset()`
* No garbage collector
None
-----------------
```
$> asc ... --runtime none
```
[No runtime](./none.ts) features at all. Useful for building low-level modules that do not require language features like managed classes, or if you'd like to compose your own runtime by including a custom memory allocator and garbage collector.
* No memory allocator
* No garbage collector

1
std/runtime/arena.ts Normal file
View File

@ -0,0 +1 @@
import "allocator/arena";

2
std/runtime/default.ts Normal file
View File

@ -0,0 +1,2 @@
import "allocator/tlsf";
import "collector/itcm";

0
std/runtime/none.ts Normal file
View File

View File

@ -0,0 +1,6 @@
{
"extends": "../assembly.json",
"include": [
"./**/*.ts"
]
}