diff options
| author | Russ Cox <rsc@golang.org> | 2022-01-30 20:13:43 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2022-04-05 17:54:15 +0000 |
| commit | 9839668b5619f45e293dd40339bf0ac614ea6bee (patch) | |
| tree | a836ea07d0a9ec5e32638d060cdeb6b4ded636dc /src/syscall | |
| parent | 81431c7aa7c5d782e72dec342442ea7664ef1783 (diff) | |
| download | go-9839668b5619f45e293dd40339bf0ac614ea6bee.tar.xz | |
all: separate doc comment from //go: directives
A future change to gofmt will rewrite
// Doc comment.
//go:foo
to
// Doc comment.
//
//go:foo
Apply that change preemptively to all comments (not necessarily just doc comments).
For #51082.
Change-Id: Iffe0285418d1e79d34526af3520b415a12203ca9
Reviewed-on: https://go-review.googlesource.com/c/go/+/384260
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/syscall')
| -rw-r--r-- | src/syscall/dir_plan9.go | 1 | ||||
| -rw-r--r-- | src/syscall/exec_bsd.go | 1 | ||||
| -rw-r--r-- | src/syscall/exec_freebsd.go | 1 | ||||
| -rw-r--r-- | src/syscall/exec_libc.go | 1 | ||||
| -rw-r--r-- | src/syscall/exec_libc2.go | 1 | ||||
| -rw-r--r-- | src/syscall/exec_linux.go | 1 | ||||
| -rw-r--r-- | src/syscall/exec_plan9.go | 4 | ||||
| -rw-r--r-- | src/syscall/syscall_linux.go | 4 |
8 files changed, 14 insertions, 0 deletions
diff --git a/src/syscall/dir_plan9.go b/src/syscall/dir_plan9.go index 4ed052de76..1667cbc02f 100644 --- a/src/syscall/dir_plan9.go +++ b/src/syscall/dir_plan9.go @@ -184,6 +184,7 @@ func gbit8(b []byte) (uint8, []byte) { } // gbit16 reads a 16-bit number in little-endian order from b and returns it with the remaining slice of b. +// //go:nosplit func gbit16(b []byte) (uint16, []byte) { return uint16(b[0]) | uint16(b[1])<<8, b[2:] diff --git a/src/syscall/exec_bsd.go b/src/syscall/exec_bsd.go index 530b48cb70..4762ae751a 100644 --- a/src/syscall/exec_bsd.go +++ b/src/syscall/exec_bsd.go @@ -49,6 +49,7 @@ func runtime_AfterForkInChild() // For the same reason compiler does not race instrument it. // The calls to RawSyscall are okay because they are assembly // functions that do not grow the stack. +// //go:norace func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err Errno) { // Declare all variables at top in case any diff --git a/src/syscall/exec_freebsd.go b/src/syscall/exec_freebsd.go index 90793fe83f..851b8fbd06 100644 --- a/src/syscall/exec_freebsd.go +++ b/src/syscall/exec_freebsd.go @@ -54,6 +54,7 @@ func runtime_AfterForkInChild() // For the same reason compiler does not race instrument it. // The calls to RawSyscall are okay because they are assembly // functions that do not grow the stack. +// //go:norace func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err Errno) { // Declare all variables at top in case any diff --git a/src/syscall/exec_libc.go b/src/syscall/exec_libc.go index c8549c4964..aee1b8c98a 100644 --- a/src/syscall/exec_libc.go +++ b/src/syscall/exec_libc.go @@ -75,6 +75,7 @@ func init() { // because we need to avoid lazy-loading the functions (might malloc, // split the stack, or acquire mutexes). We can't call RawSyscall // because it's not safe even for BSD-subsystem calls. +// //go:norace func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err Errno) { // Declare all variables at top in case any diff --git a/src/syscall/exec_libc2.go b/src/syscall/exec_libc2.go index 91a39ba1b8..9eb61a5d35 100644 --- a/src/syscall/exec_libc2.go +++ b/src/syscall/exec_libc2.go @@ -50,6 +50,7 @@ func runtime_AfterForkInChild() // For the same reason compiler does not race instrument it. // The calls to rawSyscall are okay because they are assembly // functions that do not grow the stack. +// //go:norace func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err Errno) { // Declare all variables at top in case any diff --git a/src/syscall/exec_linux.go b/src/syscall/exec_linux.go index 0f0dee8ea5..6d4b6939ad 100644 --- a/src/syscall/exec_linux.go +++ b/src/syscall/exec_linux.go @@ -77,6 +77,7 @@ func runtime_AfterForkInChild() // For the same reason compiler does not race instrument it. // The calls to RawSyscall are okay because they are assembly // functions that do not grow the stack. +// //go:norace func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err Errno) { // Set up and fork. This returns immediately in the parent or diff --git a/src/syscall/exec_plan9.go b/src/syscall/exec_plan9.go index c469fe1812..6680e6f2ef 100644 --- a/src/syscall/exec_plan9.go +++ b/src/syscall/exec_plan9.go @@ -19,6 +19,7 @@ var ForkLock sync.RWMutex // gstringb reads a non-empty string from b, prefixed with a 16-bit length in little-endian order. // It returns the string as a byte slice, or nil if b is too short to contain the length or // the full string. +// //go:nosplit func gstringb(b []byte) []byte { if len(b) < 2 { @@ -37,6 +38,7 @@ const nameOffset = 39 // gdirname returns the first filename from a buffer of directory entries, // and a slice containing the remaining directory entries. // If the buffer doesn't start with a valid directory entry, the returned name is nil. +// //go:nosplit func gdirname(buf []byte) (name []byte, rest []byte) { if len(buf) < 2 { @@ -119,6 +121,7 @@ var dupdev, _ = BytePtrFromString("#d") // no rescheduling, no malloc calls, and no new stack segments. // The calls to RawSyscall are okay because they are assembly // functions that do not grow the stack. +// //go:norace func forkAndExecInChild(argv0 *byte, argv []*byte, envv []envItem, dir *byte, attr *ProcAttr, pipe int, rflag int) (pid int, err error) { // Declare all variables at top in case any @@ -302,6 +305,7 @@ childerror1: } // close the numbered file descriptor, unless it is fd1, fd2, or a member of fds. +// //go:nosplit func closeFdExcept(n int, fd1 int, fd2 int, fds []int) { if n == fd1 || n == fd2 { diff --git a/src/syscall/syscall_linux.go b/src/syscall/syscall_linux.go index f74a79c285..a00d8c94a2 100644 --- a/src/syscall/syscall_linux.go +++ b/src/syscall/syscall_linux.go @@ -968,6 +968,7 @@ func Getpgrp() (pid int) { // Provided by runtime.syscall_runtime_doAllThreadsSyscall which stops the // world and invokes the syscall on each OS thread. Once this function returns, // all threads are in sync. +// //go:uintptrescapes func runtime_doAllThreadsSyscall(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) @@ -986,6 +987,7 @@ func runtime_doAllThreadsSyscall(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, // AllThreadsSyscall is unaware of any threads that are launched // explicitly by cgo linked code, so the function always returns // ENOTSUP in binaries that use cgo. +// //go:uintptrescapes func AllThreadsSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) { if cgo_libc_setegid != nil { @@ -997,6 +999,7 @@ func AllThreadsSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) { // AllThreadsSyscall6 is like AllThreadsSyscall, but extended to six // arguments. +// //go:uintptrescapes func AllThreadsSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) { if cgo_libc_setegid != nil { @@ -1007,6 +1010,7 @@ func AllThreadsSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, e } // linked by runtime.cgocall.go +// //go:uintptrescapes func cgocaller(unsafe.Pointer, ...uintptr) uintptr |
