diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index c439158f07..fd6b4b11a2 100644 --- a/src/runtime/mbitmap.go +++ b/src/runtime/mbitmap.go @@ -109,6 +109,9 @@ func add1(p *byte) *byte { // subtract1 returns the byte pointer p-1. //go:nowritebarrier +// +// nosplit because it is used during write barriers and must not be preempted. +//go:nosplit func subtract1(p *byte) *byte { // Note: wrote out full expression instead of calling subtractb(p, 1) // to reduce the number of temporaries generated by the @@ -245,6 +248,9 @@ func (h heapBits) prefetch() { // next returns the heapBits describing the next pointer-sized word in memory. // That is, if h describes address p, h.next() describes p+ptrSize. // Note that next does not modify h. The caller must record the result. +// +// nosplit because it is used during write barriers and must not be preempted. +//go:nosplit func (h heapBits) next() heapBits { if h.shift < 3*heapBitsShift { return heapBits{h.bitp, h.shift + heapBitsShift} @@ -293,6 +299,9 @@ func (h heapBits) setMarkedNonAtomic() { // isPointer reports whether the heap bits describe a pointer word. // h must describe the initial word of the object. +// +// nosplit because it is used during write barriers and must not be preempted. +//go:nosplit func (h heapBits) isPointer() bool { return (*h.bitp>>h.shift)&bitPointer != 0 }