]> Cypherpunks repositories - gostls13.git/commit
runtime: consistently use atomic loads for heap_live
authorAustin Clements <austin@google.com>
Fri, 21 Apr 2017 15:45:44 +0000 (11:45 -0400)
committerAustin Clements <austin@google.com>
Fri, 21 Apr 2017 17:41:51 +0000 (17:41 +0000)
commit9d36163c0b35ddd384534f850fb04170e0d0c7c4
tree4ad8eb06f8993b0ac6a444f1ca45bcc2fb231380
parent44fe0820c6c304cb56592b07c0d9b2f90c3a20ce
runtime: consistently use atomic loads for heap_live

heap_live is updated atomically without locking, so we should also use
atomic loads to read it. Fix the reads of heap_live that happen
outside of STW to be atomic.

Change-Id: Idca9451c348168c2a792a9499af349833a3c333f
Reviewed-on: https://go-review.googlesource.com/41371
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mgc.go
src/runtime/mstats.go