From cd17a717f9f49cffb40fbdef59d1dfac1f9e0cfd Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Tue, 29 Jul 2014 11:01:02 +0400 Subject: runtime: simpler and faster GC Implement the design described in: https://docs.google.com/document/d/1v4Oqa0WwHunqlb8C3ObL_uNQw3DfSY-ztoA-4wWbKcg/pub Summary of the changes: GC uses "2-bits per word" pointer type info embed directly into bitmap. Scanning of stacks/data/heap is unified. The old spans types go away. Compiler generates "sparse" 4-bits type info for GC (directly for GC bitmap). Linker generates "dense" 2-bits type info for data/bss (the same as stacks use). Summary of results: -1680 lines of code total (-1000+ in mgc0.c only) -25% memory consumption -3-7% binary size -15% GC pause reduction -7% run time reduction LGTM=khr R=golang-codereviews, rsc, christoph, khr CC=golang-codereviews, rlh https://golang.org/cl/106260045 --- src/pkg/runtime/stack.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pkg/runtime/stack.c') diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c index 1a502bd6e7..0a806e8fab 100644 --- a/src/pkg/runtime/stack.c +++ b/src/pkg/runtime/stack.c @@ -10,6 +10,7 @@ #include "typekind.h" #include "type.h" #include "race.h" +#include "mgc0.h" #include "../../cmd/ld/textflag.h" enum -- cgit v1.3