Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 50 for slicedata (0.19 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/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)
  4. pkg/proxy/endpointslicecache.go

    		}
    
    		change := &endpointsChange{}
    
    		change.previous = cache.getEndpointsMap(serviceNN, esTracker.applied)
    
    		for name, sliceData := range esTracker.pending {
    			if sliceData.remove {
    				delete(esTracker.applied, name)
    			} else {
    				esTracker.applied[name] = sliceData
    			}
    
    			delete(esTracker.pending, name)
    		}
    
    		change.current = cache.getEndpointsMap(serviceNN, esTracker.applied)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 29 21:07:21 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  5. 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)
  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/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)
  9. 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)
  10. src/go/types/builtins_test.go

    	{"Slice", `type B *byte; var b B; _ = unsafe.Slice(b, 0)`, `func(*byte, int) []byte`},
    
    	{"SliceData", "var s []int; _ = unsafe.SliceData(s)", `func([]int) *int`},
    	{"SliceData", "type S []int; var s S; _ = unsafe.SliceData(s)", `func([]int) *int`},
    
    	{"String", `var p *byte; _ = unsafe.String(p, 1)`, `func(*byte, int) string`},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 10.9K bytes
    - Viewed (0)
Back to top