]> Cypherpunks repositories - gostls13.git/commit
runtime: allow GC drain whenever write barrier is enabled
authorAustin Clements <austin@google.com>
Fri, 24 Jul 2015 16:33:23 +0000 (12:33 -0400)
committerAustin Clements <austin@google.com>
Mon, 27 Jul 2015 19:59:04 +0000 (19:59 +0000)
commitf5e67e53e79784ceb772fea50fecbd3847ae3bdf
treef1870b7773669386df21023eb33ea705df505018
parent64a32ffeee0003a6ead15a890016fea3187fabb1
runtime: allow GC drain whenever write barrier is enabled

Currently we hand-code a set of phases when draining is allowed.
However, this set of phases is conservative. The critical invariant is
simply that the write barrier must be enabled if we're draining.

Shortly we're going to enable mutator assists during the scan phase,
which means we may drain during the scan phase. In preparation, this
commit generalizes these assertions to check the fundamental condition
that the write barrier is enabled, rather than checking that we're in
any particular phase.

Change-Id: I0e1bec1ca823d4a697a0831ec4c50f5dd3f2a893
Reviewed-on: https://go-review.googlesource.com/12673
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/mgcmark.go