- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 6,658 for makeWE (0.17 sec)
-
test/typeparam/pragma.go
// errorcheck -0 -m // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Make sure the go:noinline pragma makes it from a // generic function to any of its stenciled instances. package main //go:noinline func f[T any](x T) T { return x } func main() { // ERROR "can inline main" println(f(5))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 19:45:34 UTC 2022 - 411 bytes - Viewed (0) -
test/strcopy.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Test that string([]byte(string)) makes a copy and doesn't reduce to // nothing. (Issue 25834) package main import ( "reflect" "unsafe" ) func main() { var ( buf = make([]byte, 2<<10) large = string(buf) sub = large[10:12] subcopy = string([]byte(sub))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 12 19:10:34 UTC 2018 - 674 bytes - Viewed (0) -
pkg/util/async/runner.go
*/ package async import ( "sync" ) // Runner is an abstraction to make it easy to start and stop groups of things that can be // described by a single function which waits on a channel close to exit. type Runner struct { lock sync.Mutex loopFuncs []func(stop chan struct{}) stop *chan struct{} } // NewRunner makes a runner for the given function(s). The function(s) should loop until // the channel is closed.
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Jul 29 06:37:00 UTC 2016 - 1.4K bytes - Viewed (0) -
test/fixedbugs/issue24491b.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This test makes sure unsafe-uintptr arguments are not // kept alive longer than expected. package main import ( "runtime" "unsafe" ) var done = make(chan bool) func setup() unsafe.Pointer { s := "ok" runtime.SetFinalizer(&s, func(p *string) { close(done) }) return unsafe.Pointer(&s)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Sep 13 07:54:42 UTC 2020 - 738 bytes - Viewed (0) -
src/cmd/cgo/internal/testsanitizers/testdata/tsan10.go
// Since the Go runtime makes direct futex syscalls, Go runtime threads could // run for an arbitrarily long time without triggering the libc interceptors. // See https://golang.org/issue/18717. import ( "os" "os/signal" "syscall" ) /* #cgo CFLAGS: -g -fsanitize=thread #cgo LDFLAGS: -g -fsanitize=thread */ import "C" func main() { c := make(chan os.Signal, 1)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 11:59:56 UTC 2023 - 798 bytes - Viewed (0) -
src/archive/tar/writer_test.go
var fw fileWriter switch maker := v.maker.(type) { case makeReg: fw = ®FileWriter{w, maker.size} wantStr = maker.wantStr case makeSparse: if !validateSparseEntries(maker.sph, maker.size) { t.Fatalf("invalid sparse map: %v", maker.sph) } spd := invertSparseEntries(maker.sph, maker.size) fw = ®FileWriter{w, maker.makeReg.size} fw = &sparseFileWriter{fw, spd, 0}
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 38.7K bytes - Viewed (0) -
src/runtime/testdata/testprogcgo/pprof_callback.go
// execute, when updating mp.curg. // // These are reachable only when exitsyscall finds no P available. Thus // we make C calls from significantly more Gs than there are available // Ps. Lots of runnable work combined with >20us spent in callGo makes // it possible for sysmon to retake Ps, forcing C calls to go down the // desired exitsyscall path. //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jun 08 15:44:05 UTC 2022 - 1.8K bytes - Viewed (0) -
test/typeparam/setsimp.dir/a.go
return false } } } return true } // A Set is a set of elements of some type. type Set[Elem comparable] struct { m map[Elem]struct{} } // Make makes a new set. func Make[Elem comparable]() Set[Elem] { return Set[Elem]{m: make(map[Elem]struct{})} } // Add adds an element to a set. func (s Set[Elem]) Add(v Elem) { s.m[v] = struct{}{} }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 26 21:39:54 UTC 2021 - 2.7K bytes - Viewed (0) -
test/makeslice.go
} // Test make in append panics for int slices since the gc compiler optimizes makes in appends. func testMakeInAppendInts(n uint64) { type T []int for _, length := range []int{0, 1} { t := make(T, length) shouldPanic("len out of range", func() { _ = append(t, make(T, int(n))...) }) shouldPanic("cap out of range", func() { _ = append(t, make(T, 0, int(n))...) }) shouldPanic("len out of range", func() { _ = append(t, make(T, int64(n))...) })
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 07 17:50:24 UTC 2020 - 5.5K bytes - Viewed (0) -
src/cmd/internal/objabi/path.go
// symbol table. All control characters, space, '%' and '"', as well as // non-7-bit clean bytes turn into %xx. The period needs escaping only in the // last segment of the path, and it makes for happier users if we escape that as // little as possible. func PathToPrefix(s string) string { slash := strings.LastIndex(s, "/") // check for chars that need escaping n := 0 for r := 0; r < len(s); r++ {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 13:56:25 UTC 2023 - 1.9K bytes - Viewed (0)