- Sort Score
- Result 10 results
- Languages All
Results 11 - 15 of 15 for slice_v1 (0.13 sec)
-
test/escape_reflect.go
v.SetLen(n) } func setcap(x *[]int, n int) { // ERROR "x does not escape" v := reflect.ValueOf(x).Elem() v.SetCap(n) } // Unfortunate: x doesn't need to escape to heap, just to result. func slice1(x []byte) []byte { // ERROR "leaking param: x$" v := reflect.ValueOf(x) // ERROR "x escapes to heap" return v.Slice(1, 2).Bytes() } // Unfortunate: x doesn't need to escape to heap, just to result.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 08 18:50:24 UTC 2023 - 13.1K bytes - Viewed (0) -
src/cmd/cgo/internal/testerrors/ptr_test.go
c: `struct s5 { int *p1; int *p2; }; void f5(int **p) {}`, body: `p := &C.struct_s5{p1: nil, p2: new(C.int)}; C.f5(&p.p1)`, fail: false, }, { // Passing the address of a slice with no Go pointers. name: "sliceok1", c: `void f6(void **p) {}`, imports: []string{"unsafe"}, body: `s := []unsafe.Pointer{nil}; C.f6(&s[0])`, fail: false, }, { // Passing the address of a slice with a Go pointer.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Aug 03 16:07:49 UTC 2023 - 21.2K bytes - Viewed (0) -
test/escape2n.go
} _ = f } func issue11387(x int) func() int { f := func() int { return x } // ERROR "func literal escapes to heap" slice1 := []func() int{f} // ERROR "\[\].* does not escape" slice2 := make([]func() int, 1) // ERROR "make\(.*\) does not escape" copy(slice2, slice1) return slice2[0] } func issue12397(x, y int) { // ERROR "moved to heap: y$"
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Dec 14 17:22:18 UTC 2023 - 35.1K bytes - Viewed (0) -
test/escape2.go
} _ = f } func issue11387(x int) func() int { f := func() int { return x } // ERROR "func literal escapes to heap" slice1 := []func() int{f} // ERROR "\[\].* does not escape" slice2 := make([]func() int, 1) // ERROR "make\(.*\) does not escape" copy(slice2, slice1) return slice2[0] } func issue12397(x, y int) { // ERROR "moved to heap: y$"
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Dec 14 17:22:18 UTC 2023 - 35.1K bytes - Viewed (0) -
src/internal/types/testdata/check/builtins0.go
f2 := func() (x, y int64) { return } _ = unsafe.Sizeof(f0 /* ERROR "used as value" */ ()) assert(unsafe.Sizeof(f1()) == 8) _ = unsafe.Sizeof(f2()) // ERROR "too many arguments" } func Slice1() { var x int unsafe.Slice() // ERROR "not enough arguments" unsafe.Slice(1, 2, 3) // ERROR "too many arguments" unsafe.Slice(1 /* ERROR "is not a pointer" */ , 2)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 29.3K bytes - Viewed (0)