From: Austin Clements Date: Fri, 27 Feb 2015 17:41:20 +0000 (-0500) Subject: runtime: trivial clean ups to greyobject X-Git-Tag: go1.5beta1~1827 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=da4874cba431d502a9c0764b8a68685af7bc7c35;p=gostls13.git runtime: trivial clean ups to greyobject Previously, the typeDead check in greyobject was under a separate !useCheckmark conditional. Put it with the rest of the !useCheckmark code. Also move a comment about atomic update of the marked bit to where we actually do that update now. Change-Id: Ief5f16401a25739ad57d959607b8d81ffe0bc211 Reviewed-on: https://go-review.googlesource.com/6271 Reviewed-by: Rick Hudson --- diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index 702fccae98..4592044363 100644 --- a/src/runtime/mbitmap.go +++ b/src/runtime/mbitmap.go @@ -234,6 +234,10 @@ func (h heapBits) isMarked() bool { // setMarked sets the marked bit in the heap bits, atomically. func (h heapBits) setMarked() { + // Each byte of GC bitmap holds info for two words. + // Might be racing with other updates, so use atomic update always. + // We used to be clever here and use a non-atomic update in certain + // cases, but it's not worth the risk. atomicor8(h.bitp, bitMarked<