[dev.garbage] runtime: Code to implement write barriers

To turn concurrent gc on alter the if false in func gogc
currently at line 489 in malloc.go

LGTM=rsc
R=rsc
CC=golang-codereviews, rlh
https://golang.org/cl/172190043
This commit is contained in:
Rick Hudson 2014-11-10 13:42:34 -05:00 committed by Russ Cox
parent d8ee1c5a2c
commit d3d60975b4
5 changed files with 66 additions and 16 deletions

View file

@ -486,16 +486,17 @@ func gogc(force int32) {
onM(stoptheworld)
onM(finishsweep_m) // finish sweep before we start concurrent scan.
onM(starttheworld)
// Do a concurrent heap scan before we stop the world.
onM(gcscan_m)
onM(gcinstallmarkwb_m)
onM(stoptheworld)
// onM(starttheworld)
// mark from roots scanned in gcscan_m. startthework when write barrier works
onM(gcmark_m)
// onM(stoptheworld)
if false { // To turn on concurrent scan and mark set to true...
onM(starttheworld)
// Do a concurrent heap scan before we stop the world.
onM(gcscan_m)
onM(stoptheworld)
onM(gcinstallmarkwb_m)
onM(starttheworld)
onM(gcmark_m)
onM(stoptheworld)
onM(gcinstalloffwb_m)
}
if mp != acquirem() {
gothrow("gogc: rescheduled")
}