Skip to content

Commit f73b2fc

Browse files
committed
runtime: remove unused _GCsweep state
We don't use this state. _GCoff means we're sweeping in the background. This makes it clear in the next commit that _GCoff and only _GCoff means sweeping. Change-Id: I416324a829ba0be3794a6cf3cf1655114cb6e47c Reviewed-on: https://go-review.googlesource.com/11501 Reviewed-by: Rick Hudson <[email protected]> Reviewed-by: Russ Cox <[email protected]>
1 parent 4e61c51 commit f73b2fc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/runtime/mgc.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,12 @@
4646
// 11. GC preempts P's one-by-one taking partial wbufs and marks all unmarked yet
4747
// reachable objects.
4848
// 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.
5050
// 13. Wait for all P's to acknowledge phase change.
5151
// 14. Now malloc allocates white (but sweeps spans before use).
5252
// Write barrier becomes nop.
5353
// 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,
5655
// see discussion of GC rate below.
5756

5857
// Changing phases.
@@ -241,12 +240,11 @@ var gcBlackenEnabled uint32
241240
var gcBlackenPromptly bool
242241

243242
const (
244-
_GCoff = iota // GC not running, write barrier disabled
243+
_GCoff = iota // GC not running; sweeping in background, write barrier disabled
245244
_GCstw // unused state
246245
_GCscan // GC collecting roots into workbufs, write barrier ENABLED
247246
_GCmark // GC marking from workbufs, write barrier ENABLED
248247
_GCmarktermination // GC mark termination: allocate black, P's help GC, write barrier ENABLED
249-
_GCsweep // GC mark completed; sweeping in background, write barrier disabled
250248
)
251249

252250
//go:nosplit

0 commit comments

Comments
 (0)