Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit c393bbd

Browse files
authored
doc: modifies the GC section (#449)
Signed-off-by: Takeshi Yoneda <[email protected]>
1 parent 4b4272f commit c393bbd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/OVERVIEW.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,10 @@ Internally, `runtime.GC` is called whenever the heap runs out (see
462462
[1](https://tinygo.org/lang-support/#garbage-collection),
463463
[2](https://github.com/tinygo-org/tinygo/blob/v0.14.1/src/runtime/gc_conservative.go#L218-L239)) in TinyGo.
464464

465-
TinyGo allows us to disable GC, but we cannot do that since internally we need to use maps (implicitly causes allocation) for saving the Virtual Machine's state. Theoretically, we can implement our own GC algorithms tailored for proxy-wasm through `alloc(uintptr)` [interface](https://github.com/tinygo-org/tinygo/blob/v0.14.1/src/runtime/gc_none.go#L13) with `-gc=none` option. This is a future TODO.
465+
TinyGo allows us to disable GC, so theoretically, we can implement our own GC algorithms tailored for Proxy-Wasm through with `-gc=custom` and the build tag `-tags=custommalloc`.
466+
For example, create an arena for each context and free the arena when the context is destroyed. However, it is difficult to implement that
467+
since internally we need to use global maps (implicitly causes allocation outside the context scope, globally) for saving the Virtual Machine's state (e.g. context id to context implementation mapping).
468+
So this is not implemented yet, and that is a future TODO.
466469

467470
## `recover` not implemented
468471

0 commit comments

Comments
 (0)