From 00e91ec56975c3fbc600d4ed164ac2e493327624 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sun, 17 Feb 2019 20:19:08 +0100 Subject: [PATCH] all: rename garbage collectors dumb -> leaking: make it more clear what this "GC" does: leak everything. marksweep -> conservative: "marksweep" is too generic, use "conservative" to differentiate between future garbage collectors: precise marksweep / mark-compact / refcounting. --- compiler/compiler.go | 2 +- main.go | 2 +- src/runtime/{gc_marksweep.go => gc_conservative.go} | 2 +- src/runtime/{gc_dumb.go => gc_leaking.go} | 2 +- targets/cortex-m.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename src/runtime/{gc_marksweep.go => gc_conservative.go} (99%) rename src/runtime/{gc_dumb.go => gc_leaking.go} (98%) 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": [