|
46 | 46 | // 11. GC preempts P's one-by-one taking partial wbufs and marks all unmarked yet
|
47 | 47 | // reachable objects.
|
48 | 48 | // 12. When GC completes a full cycle over P's and discovers no new grey
|
49 |
| -// objects, (which means all reachable objects are marked) set phase = GCsweep. |
| 49 | +// objects, (which means all reachable objects are marked) set phase = GCoff. |
50 | 50 | // 13. Wait for all P's to acknowledge phase change.
|
51 | 51 | // 14. Now malloc allocates white (but sweeps spans before use).
|
52 | 52 | // Write barrier becomes nop.
|
53 | 53 | // 15. GC does background sweeping, see description below.
|
54 |
| -// 16. When sweeping is complete set phase to GCoff. |
55 |
| -// 17. When sufficient allocation has taken place replay the sequence starting at 0 above, |
| 54 | +// 16. When sufficient allocation has taken place replay the sequence starting at 0 above, |
56 | 55 | // see discussion of GC rate below.
|
57 | 56 |
|
58 | 57 | // Changing phases.
|
@@ -241,12 +240,11 @@ var gcBlackenEnabled uint32
|
241 | 240 | var gcBlackenPromptly bool
|
242 | 241 |
|
243 | 242 | const (
|
244 |
| - _GCoff = iota // GC not running, write barrier disabled |
| 243 | + _GCoff = iota // GC not running; sweeping in background, write barrier disabled |
245 | 244 | _GCstw // unused state
|
246 | 245 | _GCscan // GC collecting roots into workbufs, write barrier ENABLED
|
247 | 246 | _GCmark // GC marking from workbufs, write barrier ENABLED
|
248 | 247 | _GCmarktermination // GC mark termination: allocate black, P's help GC, write barrier ENABLED
|
249 |
| - _GCsweep // GC mark completed; sweeping in background, write barrier disabled |
250 | 248 | )
|
251 | 249 |
|
252 | 250 | //go:nosplit
|
|
0 commit comments