1
0
mirror of https://github.com/golang/go synced 2024-09-28 20:24:29 -06:00

runtime: gofmt -w -s

This commit is contained in:
Jes Cok 2023-11-16 14:58:16 +08:00
parent d6ef98b8fa
commit 3c8382442a
6 changed files with 33 additions and 33 deletions

View File

@ -116,7 +116,7 @@ func storeRegArgs(dst *sigcontext, src *abi.RegArgs) {
func loadRegArgs(dst *abi.RegArgs, src *sigcontext) {
// Gprs R3..R10, R14..R17 are used to pass int arguments in registers on PPC64
for i, _ := range [12]int{} {
for i := range [12]int{} {
if i > 7 {
dst.Ints[i] = uintptr(src.gp_regs[i+6])
} else {
@ -124,7 +124,7 @@ func loadRegArgs(dst *abi.RegArgs, src *sigcontext) {
}
}
// Fprs F1..F13 are used to pass float arguments in registers on PPC64
for i, _ := range [12]int{} {
for i := range [12]int{} {
dst.Floats[i] = math.Float64bits(src.fp_regs[i+1])
}

View File

@ -848,7 +848,7 @@ func testSchedPauseMetrics(t *testing.T, fn func(t *testing.T), isGC bool) {
}
func TestSchedPauseMetrics(t *testing.T) {
tests := []struct{
tests := []struct {
name string
isGC bool
fn func(t *testing.T)
@ -856,13 +856,13 @@ func TestSchedPauseMetrics(t *testing.T) {
{
name: "runtime.GC",
isGC: true,
fn: func(t *testing.T) {
fn: func(t *testing.T) {
runtime.GC()
},
},
{
name: "runtime.GOMAXPROCS",
fn: func(t *testing.T) {
fn: func(t *testing.T) {
if runtime.GOARCH == "wasm" {
t.Skip("GOMAXPROCS >1 not supported on wasm")
}
@ -870,33 +870,33 @@ func TestSchedPauseMetrics(t *testing.T) {
n := runtime.GOMAXPROCS(0)
defer runtime.GOMAXPROCS(n)
runtime.GOMAXPROCS(n+1)
runtime.GOMAXPROCS(n + 1)
},
},
{
name: "runtime.GoroutineProfile",
fn: func(t *testing.T) {
fn: func(t *testing.T) {
var s [1]runtime.StackRecord
runtime.GoroutineProfile(s[:])
},
},
{
name: "runtime.ReadMemStats",
fn: func(t *testing.T) {
fn: func(t *testing.T) {
var mstats runtime.MemStats
runtime.ReadMemStats(&mstats)
},
},
{
name: "runtime.Stack",
fn: func(t *testing.T) {
fn: func(t *testing.T) {
var b [64]byte
runtime.Stack(b[:], true)
},
},
{
name: "runtime/debug.WriteHeapDump",
fn: func(t *testing.T) {
fn: func(t *testing.T) {
if runtime.GOOS == "js" {
t.Skip("WriteHeapDump not supported on js")
}
@ -912,7 +912,7 @@ func TestSchedPauseMetrics(t *testing.T) {
},
{
name: "runtime/trace.Start",
fn: func(t *testing.T) {
fn: func(t *testing.T) {
if trace.IsEnabled() {
t.Skip("tracing already enabled")
}

View File

@ -418,7 +418,7 @@ type workType struct {
stwprocs, maxprocs int32
tSweepTerm, tMark, tMarkTerm, tEnd int64 // nanotime() of phase start
pauseNS int64 // total STW time this cycle
pauseNS int64 // total STW time this cycle
// debug.gctrace heap sizes for this cycle.
heap0, heap1, heap2 uint64

View File

@ -29,7 +29,6 @@ func stackSwitchCallback() {
debug.SetGCPercent(gogc)
}
// Regression test for https://go.dev/issue/62440. It should be possible for C
// threads to call into Go from different stacks without crashing due to g0
// stack bounds checks.
@ -37,7 +36,7 @@ func stackSwitchCallback() {
// N.B. This is only OK for threads created in C. Threads with Go frames up the
// stack must not change the stack out from under us.
func StackSwitchCallback() {
C.callStackSwitchCallbackFromThread();
C.callStackSwitchCallbackFromThread()
fmt.Printf("OK\n")
}

View File

@ -18,6 +18,7 @@ import (
// The bug is that netpollWaiters increases monotonically.
// This doesn't cause a problem until it overflows.
// Use linkname to see the value.
//
//go:linkname netpollWaiters runtime.netpollWaiters
var netpollWaiters atomic.Uint32

View File

@ -1,19 +1,19 @@
package main
import (
"os"
"syscall"
)
func main() {
dll := syscall.MustLoadDLL("veh.dll")
RaiseNoExcept := dll.MustFindProc("RaiseNoExcept")
ThreadRaiseNoExcept := dll.MustFindProc("ThreadRaiseNoExcept")
thread := len(os.Args) > 1 && os.Args[1] == "thread"
if !thread {
RaiseNoExcept.Call()
} else {
ThreadRaiseNoExcept.Call()
}
}
package main
import (
"os"
"syscall"
)
func main() {
dll := syscall.MustLoadDLL("veh.dll")
RaiseNoExcept := dll.MustFindProc("RaiseNoExcept")
ThreadRaiseNoExcept := dll.MustFindProc("ThreadRaiseNoExcept")
thread := len(os.Args) > 1 && os.Args[1] == "thread"
if !thread {
RaiseNoExcept.Call()
} else {
ThreadRaiseNoExcept.Call()
}
}