gaukas / watm

WebAssembly Transport Module
GNU General Public License v3.0
1 stars 0 forks source link

bug: memory leak risk in all tinygo/v0/examples #11

Closed gaukas closed 5 months ago

gaukas commented 5 months ago

Allocations occurred in the helper library tinygo/v0 has introduced risk of memory leak. While Go is a garbage-collected language, memory leak may only happen when we compile with tinygo and use -gc=leaking.

Although -gc=leaking is somewhat helpful at further reducing the size of a compiled artifact, it is important to note that anything failing the compilation with -gc=none (i.e., allocates on-heap memory) will subject to memory leak if compiled using -gc=leaking.

In this case, we should probably consider compiling current example WATMs with -gc=conservative (or -gc=precise).

gaukas commented 5 months ago

Fixed in eae4ebe13a919bdf620aeed822d9ecabfee6f6db and ab7c0dd83c42545e70662c136671dd7b054c49c6.