From: Than McIntosh Date: Mon, 10 Oct 2022 17:49:54 +0000 (-0400) Subject: runtime: mark arenaIdx.l1 and arenaIdx.l2 methods as nosplit X-Git-Tag: go1.20rc1~686 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=506e690a26390d137b8bfc01d90121581c3d6f7a;p=gostls13.git runtime: mark arenaIdx.l1 and arenaIdx.l2 methods as nosplit Mark the "l1" and "l2" methods on "arenaIdx" with //go:nosplit, since these methods are called from a nosplit context (for example, from "spanOf"). Fixes #56044. Updates #21314. Change-Id: I48c7aa756b59a13162c89ef21066f83371ae50f1 Reviewed-on: https://go-review.googlesource.com/c/go/+/441859 Reviewed-by: Cherry Mui Run-TryBot: Than McIntosh TryBot-Result: Gopher Robot --- diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 995cb2ae9c..8d8a75a8f4 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -576,6 +576,12 @@ func arenaBase(i arenaIdx) uintptr { type arenaIdx uint +// l1 returns the "l1" portion of an arenaIdx. +// +// Marked nosplit because it's called by spanOf and other nosplit +// functions. +// +//go:nosplit func (i arenaIdx) l1() uint { if arenaL1Bits == 0 { // Let the compiler optimize this away if there's no @@ -586,6 +592,12 @@ func (i arenaIdx) l1() uint { } } +// l2 returns the "l2" portion of an arenaIdx. +// +// Marked nosplit because it's called by spanOf and other nosplit funcs. +// functions. +// +//go:nosplit func (i arenaIdx) l2() uint { if arenaL1Bits == 0 { return uint(i)