]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: consolidate "is sweep done" conditions
authorAustin Clements <austin@google.com>
Tue, 6 Apr 2021 23:25:28 +0000 (19:25 -0400)
committerAustin Clements <austin@google.com>
Mon, 12 Apr 2021 19:22:52 +0000 (19:22 +0000)
commit1b736b3c19375f6ebd0d834c02316fb13700be27
tree82814077b9ad2d5476b28920febd14a45b6ac56d
parenta25a77aed2d76b0aebff8892477f27283398a932
runtime: consolidate "is sweep done" conditions

The runtime currently has two different notions of sweep completion:

1. All spans are either swept or have begun sweeping.

2. The sweeper has *finished* sweeping all spans.

Having both is confusing (it doesn't help that the documentation is
often unclear or wrong). Condition 2 is stronger and the theoretical
slight optimization that condition 1 could impact is never actually
useful. Hence, this CL consolidates both conditions down to condition 2.

Updates #45315.

Change-Id: I55c84d767d74eb31a004a5619eaba2e351162332
Reviewed-on: https://go-review.googlesource.com/c/go/+/307916
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/mgc.go
src/runtime/mgcsweep.go
src/runtime/mheap.go