Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for slicedata2 (0.26 sec)

  1. src/cmd/compile/internal/staticdata/embed.go

    		}
    
    	case embedFiles:
    		slicedata := v.Sym().Pkg.Lookup(v.Sym().Name + `.files`).Linksym()
    		off := 0
    		// []files pointed at by Files
    		off = objw.SymPtr(slicedata, off, slicedata, 3*types.PtrSize) // []file, pointing just past slice
    		off = objw.Uintptr(slicedata, off, uint64(len(files)))
    		off = objw.Uintptr(slicedata, off, uint64(len(files)))
    
    		// embed/embed.go type file is:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 10 18:22:02 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  2. test/unsafe_slice_data.go

    import (
    	"fmt"
    	"reflect"
    	"unsafe"
    )
    
    func main() {
    	var s = []byte("abc")
    	sh1 := *(*reflect.SliceHeader)(unsafe.Pointer(&s))
    	ptr2 := unsafe.Pointer(unsafe.SliceData(s))
    	if ptr2 != unsafe.Pointer(sh1.Data) {
    		panic(fmt.Errorf("unsafe.SliceData %p != %p", ptr2, unsafe.Pointer(sh1.Data)))
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 31 17:15:15 UTC 2022
    - 481 bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/universe.go

    	_Alignof:    {"Alignof", 1, false, expression},
    	_Offsetof:   {"Offsetof", 1, false, expression},
    	_Sizeof:     {"Sizeof", 1, false, expression},
    	_Slice:      {"Slice", 2, false, expression},
    	_SliceData:  {"SliceData", 1, false, expression},
    	_String:     {"String", 2, false, expression},
    	_StringData: {"StringData", 1, false, expression},
    
    	_Assert: {"assert", 1, false, statement},
    	_Trace:  {"trace", 0, true, statement},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  4. src/go/types/universe.go

    	_Alignof:    {"Alignof", 1, false, expression},
    	_Offsetof:   {"Offsetof", 1, false, expression},
    	_Sizeof:     {"Sizeof", 1, false, expression},
    	_Slice:      {"Slice", 2, false, expression},
    	_SliceData:  {"SliceData", 1, false, expression},
    	_String:     {"String", 2, false, expression},
    	_StringData: {"StringData", 1, false, expression},
    
    	_Assert: {"assert", 1, false, statement},
    	_Trace:  {"trace", 0, true, statement},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  5. src/internal/types/testdata/fixedbugs/issue64406.go

    // license that can be found in the LICENSE file.
    
    package issue64406
    
    import (
    	"unsafe"
    )
    
    func sliceData[E any, S ~[]E](s S) *E {
    	return unsafe.SliceData(s)
    }
    
    func slice[E any, S ~*E](s S) []E {
    	return unsafe.Slice(s, 0)
    }
    
    func f() {
    	s := []uint32{0}
    	_ = sliceData(s)
    	_ = slice(&s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 29 20:34:33 UTC 2023
    - 403 bytes
    - Viewed (0)
  6. src/internal/syscall/unix/arc4random_darwin.go

    func ARC4Random(p []byte) {
    	// macOS 11 and 12 abort if length is 0.
    	if len(p) == 0 {
    		return
    	}
    	syscall_syscall(abi.FuncPCABI0(libc_arc4random_buf_trampoline),
    		uintptr(unsafe.Pointer(unsafe.SliceData(p))), uintptr(len(p)), 0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 19 20:02:21 UTC 2024
    - 633 bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/aes/cache.go

    func toString(b []byte) string {
    	// unsafe.SliceData relies on cap whereas we want to rely on len
    	if len(b) == 0 {
    		return ""
    	}
    	// Copied from go 1.20.1 strings.Builder.String
    	// https://github.com/golang/go/blob/202a1a57064127c3f19d96df57b9f9586145e21c/src/strings/builder.go#L48
    	return unsafe.String(unsafe.SliceData(b), len(b))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jul 21 19:25:52 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  8. test/unsafebuiltins.go

    	}
    
    	// unsafe.StringData
    	{
    		var s = "string"
    		assert(string(unsafe.Slice(unsafe.StringData(s), len(s))) == s)
    	}
    
    	//unsafe.SliceData
    	{
    		var s = []byte("slice")
    		assert(unsafe.String(unsafe.SliceData(s), len(s)) == string(s))
    	}
    }
    
    func assert(ok bool) {
    	if !ok {
    		panic("FAIL")
    	}
    }
    
    func mustPanic(f func()) {
    	defer func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 31 17:15:15 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  9. test/fixedbugs/issue59293.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    import "unsafe"
    
    //go:noinline
    func f(x []byte) bool {
    	return unsafe.SliceData(x) != nil
    }
    
    //go:noinline
    func g(x string) bool {
    	return unsafe.StringData(x) != nil
    }
    
    func main() {
    	if f(nil) {
    		panic("bad f")
    	}
    	if g("") {
    		panic("bad g")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 28 19:55:43 UTC 2023
    - 433 bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/cache.go

    func toString(b []byte) string {
    	// unsafe.SliceData relies on cap whereas we want to rely on len
    	if len(b) == 0 {
    		return ""
    	}
    	// Copied from go 1.20.1 strings.Builder.String
    	// https://github.com/golang/go/blob/202a1a57064127c3f19d96df57b9f9586145e21c/src/strings/builder.go#L48
    	return unsafe.String(unsafe.SliceData(b), len(b))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 31 20:26:58 UTC 2023
    - 3.5K bytes
    - Viewed (0)
Back to top