]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add a hook to disable precise GC
authorIan Lance Taylor <iant@golang.org>
Fri, 12 Apr 2013 12:23:38 +0000 (05:23 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 12 Apr 2013 12:23:38 +0000 (05:23 -0700)
This will let us ask people to rebuild the Go system without
precise GC, and then rebuild and retest their program, to see
if precise GC is causing whatever problem they are having.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8700043

src/pkg/runtime/mgc0.c

index 64b5f0464a971fbc24e245e4b21649b8789a7801..f9dbdbb4a111d917b8d71f56ae83bf754f9986a3 100644 (file)
@@ -19,6 +19,7 @@ enum {
        DebugMark = 0,  // run second pass to check mark
        CollectStats = 0,
        ScanStackByFrames = 0,
+       IgnorePreciseGC = 0,
 
        // Four bits per word (see #defines below).
        wordsPerBitmapWord = sizeof(void*)*8/4,
@@ -771,6 +772,9 @@ scanblock(Workbuf *wbuf, Obj *wp, uintptr nobj, bool keepworking)
                        pc = defaultProg;
                }
 
+               if(IgnorePreciseGC)
+                       pc = defaultProg;
+
                pc++;
                stack_top.b = (uintptr)b;