Commit cc94e249e1 for golang
commit cc94e249e14f67c7624a02e305ef1a70d75b1348
Author: khr@golang.org <khr@golang.org>
Date: Sat Nov 28 07:59:40 2026 -0800
runtime: mark a few more functions nosplit
They are called from nosplit functions, so they must be nosplit themselves.
Normally they inline so it is not a problem, but with all=-l, they can
still have an entry preemption point.
Fixes #83357
Update #21314
Change-Id: I5f23bbe04cee443da5f4a682604d57a5205dbcec
Reviewed-on: https://go-review.googlesource.com/c/go/+/868101
Reviewed-by: PJ Malloy <pjmalloy@google.com>
Reviewed-by: t hepudds <thepudds1460@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go
index 0a862a9c8d..44b76668a5 100644
--- a/src/runtime/mbitmap.go
+++ b/src/runtime/mbitmap.go
@@ -1517,6 +1517,10 @@ func (s *mspan) countAlloc() int {
// Read the bytes starting at the aligned pointer p into a uintptr.
// Read is little-endian.
+//
+// nosplit because it is called from nosplit functions (during writer barriers, mostly).
+//
+//go:nosplit
func readUintptr(p *byte) uintptr {
x := *(*uintptr)(unsafe.Pointer(p))
if goarch.BigEndian {
diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go
index 856b2454fa..b1d9016116 100644
--- a/src/runtime/mheap.go
+++ b/src/runtime/mheap.go
@@ -515,6 +515,9 @@ type mspan struct {
largeType *_type // malloc header for large objects.
}
+// nosplit because it's called from nosplit functions.
+//
+//go:nosplit
func (s *mspan) base() uintptr {
return s.startAddr
}