]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: make {add,subtract}{b,1} nosplit
authorAustin Clements <austin@google.com>
Wed, 27 Apr 2016 18:30:01 +0000 (14:30 -0400)
committerAustin Clements <austin@google.com>
Wed, 27 Apr 2016 18:46:00 +0000 (18:46 +0000)
These are used at the bottom level of various GC operations that must
not be preempted. To be on the safe side, mark them all nosplit.

Change-Id: I8f7360e79c9852bd044df71413b8581ad764380c
Reviewed-on: https://go-review.googlesource.com/22504
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mbitmap.go

index f025ce1c68836158c492c2d64277ab0783ce306b..e8eb6a7e2224e40f39519892968a2dc5509d1f7b 100644 (file)
@@ -86,6 +86,7 @@ const (
 
 // addb returns the byte pointer p+n.
 //go:nowritebarrier
+//go:nosplit
 func addb(p *byte, n uintptr) *byte {
        // Note: wrote out full expression instead of calling add(p, n)
        // to reduce the number of temporaries generated by the
@@ -95,6 +96,7 @@ func addb(p *byte, n uintptr) *byte {
 
 // subtractb returns the byte pointer p-n.
 //go:nowritebarrier
+//go:nosplit
 func subtractb(p *byte, n uintptr) *byte {
        // Note: wrote out full expression instead of calling add(p, -n)
        // to reduce the number of temporaries generated by the
@@ -104,6 +106,7 @@ func subtractb(p *byte, n uintptr) *byte {
 
 // add1 returns the byte pointer p+1.
 //go:nowritebarrier
+//go:nosplit
 func add1(p *byte) *byte {
        // Note: wrote out full expression instead of calling addb(p, 1)
        // to reduce the number of temporaries generated by the