aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/netpoll.go
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2022-08-07 17:43:57 +0700
committerCuong Manh Le <cuong.manhle.vn@gmail.com>2022-08-19 00:29:18 +0000
commita719a78c1b36141af68d84970695fe95263fb896 (patch)
treec985cb9d95db5fdc57c5cf347f544b93bed82b1d /src/runtime/netpoll.go
parent833367e98af838a2511ee7e4e19dc8f1da7b8ed7 (diff)
downloadgo-a719a78c1b36141af68d84970695fe95263fb896.tar.gz
go-a719a78c1b36141af68d84970695fe95263fb896.zip
runtime: add and use runtime/internal/sys.NotInHeap
Updates #46731 Change-Id: Ic2208c8bb639aa1e390be0d62e2bd799ecf20654 Reviewed-on: https://go-review.googlesource.com/c/go/+/421878 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Diffstat (limited to 'src/runtime/netpoll.go')
-rw-r--r--src/runtime/netpoll.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/netpoll.go b/src/runtime/netpoll.go
index 7933f36db7..833d793d88 100644
--- a/src/runtime/netpoll.go
+++ b/src/runtime/netpoll.go
@@ -8,6 +8,7 @@ package runtime
import (
"runtime/internal/atomic"
+ "runtime/internal/sys"
"unsafe"
)
@@ -68,9 +69,8 @@ const pollBlockSize = 4 * 1024
// Network poller descriptor.
//
// No heap pointers.
-//
-//go:notinheap
type pollDesc struct {
+ _ sys.NotInHeap
link *pollDesc // in pollcache, protected by pollcache.lock
fd uintptr // constant for pollDesc usage lifetime
@@ -641,8 +641,8 @@ func (c *pollCache) alloc() *pollDesc {
// makeArg converts pd to an interface{}.
// makeArg does not do any allocation. Normally, such
// a conversion requires an allocation because pointers to
-// go:notinheap types (which pollDesc is) must be stored
-// in interfaces indirectly. See issue 42076.
+// types which embed runtime/internal/sys.NotInHeap (which pollDesc is)
+// must be stored in interfaces indirectly. See issue 42076.
func (pd *pollDesc) makeArg() (i any) {
x := (*eface)(unsafe.Pointer(&i))
x._type = pdType