runtime: implement precise GC

This implements the block-based GC as a partially precise GC. This means
that for most heap allocations it is known which words contain a pointer
and which don't. This should in theory make the GC faster (because it
can skip non-pointer object) and have fewer false positives in a GC
cycle. It does however use a bit more RAM to store the layout of each
object.

Right now this GC seems to be slower than the conservative GC, but
should be less likely to run out of memory as a result of false
positives.
This commit is contained in:
Ayke van Laethem
2022-12-15 21:24:17 +01:00
committed by Ayke
parent f9d0ff3bec
commit 655075e5e0
15 changed files with 225 additions and 20 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build gc.conservative && !tinygo.wasm
//go:build (gc.conservative || gc.precise) && !tinygo.wasm
package runtime