diff --git a/compiler/compiler.go b/compiler/compiler.go index 00e008fb..d82c00f2 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -169,7 +169,7 @@ func (c *Compiler) TargetData() llvm.TargetData { func (c *Compiler) selectGC() string { gc := c.GC if gc == "" { - gc = "dumb" + gc = "leaking" } return gc } diff --git a/main.go b/main.go index 99d021d3..ad5ede3e 100644 --- a/main.go +++ b/main.go @@ -585,7 +585,7 @@ func handleCompilerError(err error) { func main() { outpath := flag.String("o", "", "output filename") opt := flag.String("opt", "z", "optimization level: 0, 1, 2, s, z") - gc := flag.String("gc", "", "garbage collector to use (none, dumb, marksweep)") + gc := flag.String("gc", "", "garbage collector to use (none, leaking, conservative)") panicStrategy := flag.String("panic", "print", "panic strategy (abort, trap)") printIR := flag.Bool("printir", false, "print LLVM IR") dumpSSA := flag.Bool("dumpssa", false, "dump internal Go SSA") diff --git a/src/runtime/gc_marksweep.go b/src/runtime/gc_conservative.go similarity index 99% rename from src/runtime/gc_marksweep.go rename to src/runtime/gc_conservative.go index 45eab6bc..dd1e5211 100644 --- a/src/runtime/gc_marksweep.go +++ b/src/runtime/gc_conservative.go @@ -1,4 +1,4 @@ -// +build gc.marksweep +// +build gc.conservative package runtime diff --git a/src/runtime/gc_dumb.go b/src/runtime/gc_leaking.go similarity index 98% rename from src/runtime/gc_dumb.go rename to src/runtime/gc_leaking.go index 92527364..fb0f9086 100644 --- a/src/runtime/gc_dumb.go +++ b/src/runtime/gc_leaking.go @@ -1,4 +1,4 @@ -// +build gc.dumb +// +build gc.leaking package runtime diff --git a/targets/cortex-m.json b/targets/cortex-m.json index a8e8f612..7fb1b028 100644 --- a/targets/cortex-m.json +++ b/targets/cortex-m.json @@ -3,7 +3,7 @@ "goos": "linux", "goarch": "arm", "compiler": "clang", - "gc": "marksweep", + "gc": "conservative", "linker": "ld.lld", "rtlib": "compiler-rt", "cflags": [