diff options
| author | Keith Randall <khr@golang.org> | 2014-09-30 08:51:02 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2014-09-30 08:51:02 -0700 |
| commit | ac9218f5f06dabec3ef7682619dd98fe587d6c08 (patch) | |
| tree | 2f2f675af7fa24bea775c86e7490f5c90401ed30 /src | |
| parent | 12308d5a0bb424ef3ee9a664c77192b48e3df84c (diff) | |
| download | go-ac9218f5f06dabec3ef7682619dd98fe587d6c08.tar.xz | |
runtime: fix scanning of gc work buffer
GC types were not being generated for the garbage collector
work buffer. The markfor object was being collected as a result.
This broke amd64p32 and maybe plan9 builds. Why it didn't break
every build I'm not sure...
Fixes #8812
LGTM=0intro, rsc
R=golang-codereviews, dave, khr, 0intro, rsc
CC=golang-codereviews
https://golang.org/cl/149260043
Diffstat (limited to 'src')
| -rw-r--r-- | src/runtime/mgc0.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/runtime/mgc0.c b/src/runtime/mgc0.c index c92fa1db73..9b9bc0ef13 100644 --- a/src/runtime/mgc0.c +++ b/src/runtime/mgc0.c @@ -140,7 +140,8 @@ static BitVector unrollglobgcprog(byte *prog, uintptr size); void runtime·bgsweep(void); static FuncVal bgsweepv = {runtime·bgsweep}; -struct { +typedef struct WorkData WorkData; +struct WorkData { uint64 full; // lock-free list of full blocks uint64 empty; // lock-free list of empty blocks byte pad0[CacheLineSize]; // prevents false-sharing between full/empty and nproc/nwait @@ -154,7 +155,8 @@ struct { // Copy of mheap.allspans for marker or sweeper. MSpan** spans; uint32 nspan; -} runtime·work; +}; +WorkData runtime·work; // scanblock scans a block of n bytes starting at pointer b for references // to other objects, scanning any it finds recursively until there are no @@ -1038,7 +1040,8 @@ runtime·MSpan_Sweep(MSpan *s, bool preserve) // State of background runtime·sweep. // Protected by runtime·gclock. -struct +typedef struct SweepData SweepData; +struct SweepData { G* g; bool parked; @@ -1047,7 +1050,8 @@ struct uint32 nbgsweep; uint32 npausesweep; -} runtime·sweep; +}; +SweepData runtime·sweep; // sweeps one span // returns number of pages returned to heap, or -1 if there is nothing to sweep |
