mirror of
https://github.com/golang/go
synced 2024-11-12 04:30:22 -07:00
runtime: make {add,subtract}{b,1} nosplit
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>
This commit is contained in:
parent
bddfc337f9
commit
30172f1811
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user