Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 80 for stringData (0.67 sec)

  1. src/strings/clone_test.go

    		}
    
    		if len(input) != 0 && unsafe.StringData(clone) == unsafe.StringData(input) {
    			t.Errorf("Clone(%q) return value should not reference inputs backing memory.", input)
    		}
    
    		if len(input) == 0 && unsafe.StringData(clone) != unsafe.StringData(emptyString) {
    			t.Errorf("Clone(%#v) return value should be equal to empty string.", unsafe.StringData(input))
    		}
    	}
    }
    
    func BenchmarkClone(b *testing.B) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 17:24:17 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  2. src/runtime/minmax_test.go

    		if z := min(x[i], x[j], x[k]); unsafe.StringData(z) != unsafe.StringData(x[i]) {
    			t.Errorf("min(x[%v], x[%v], x[%v]) = %p, want %p", i, j, k, unsafe.StringData(z), unsafe.StringData(x[i]))
    		}
    		if z := max(x[i], x[j], x[k]); unsafe.StringData(z) != unsafe.StringData(x[i]) {
    			t.Errorf("max(x[%v], x[%v], x[%v]) = %p, want %p", i, j, k, unsafe.StringData(z), unsafe.StringData(x[i]))
    		}
    	}
    
    	test(0, 1, 2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 26 01:41:50 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  3. test/unsafe_string_data.go

    import (
    	"fmt"
    	"reflect"
    	"unsafe"
    )
    
    func main() {
    	var s = "abc"
    	sh1 := (*reflect.StringHeader)(unsafe.Pointer(&s))
    	ptr2 := unsafe.Pointer(unsafe.StringData(s))
    	if ptr2 != unsafe.Pointer(sh1.Data) {
    		panic(fmt.Errorf("unsafe.StringData ret %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
    - 479 bytes
    - Viewed (0)
  4. test/unsafebuiltins.go

    		last := (*byte)(unsafe.Pointer(^uintptr(0)))
    		_ = unsafe.String(last, 1)
    		mustPanic(func() { _ = unsafe.String(last, 2) })
    	}
    
    	// 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))
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 31 17:15:15 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  5. src/go/internal/gcimporter/iimport.go

    	data, err := saferio.ReadData(r, sLen+dLen)
    	if err != nil {
    		errorf("cannot read %d bytes of stringData and declData: %s", sLen+dLen, err)
    	}
    	stringData := data[:sLen]
    	declData := data[sLen:]
    
    	p := iimporter{
    		exportVersion: version,
    		ipath:         path,
    		version:       int(version),
    
    		stringData:  stringData,
    		stringCache: make(map[uint64]string),
    		pkgCache:    make(map[uint64]*types.Package),
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  6. src/runtime/arena_test.go

    	asCopy := UserArenaClone(as)
    	if unsafe.StringData(as) == unsafe.StringData(asCopy) {
    		t.Error("Clone did not make a copy")
    	}
    
    	// Clone should make a copy of subAs, since subAs is just part of as and so is in the arena.
    	subAs := as[1:3]
    	subAsCopy := UserArenaClone(subAs)
    	if unsafe.StringData(subAs) == unsafe.StringData(subAsCopy) {
    		t.Error("Clone did not make a copy")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 13.4K bytes
    - Viewed (0)
  7. staging/src/k8s.io/api/testdata/v1.30.0/core.v1.Secret.json

            "fieldsType": "fieldsTypeValue",
            "fieldsV1": {},
            "subresource": "subresourceValue"
          }
        ]
      },
      "immutable": true,
      "data": {
        "dataKey": "Ag=="
      },
      "stringData": {
        "stringDataKey": "stringDataValue"
      },
      "type": "typeValue"
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 08:52:25 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  8. staging/src/k8s.io/api/testdata/v1.30.0/core.v1.Secret.yaml

        blockOwnerDeletion: true
        controller: true
        kind: kindValue
        name: nameValue
        uid: uidValue
      resourceVersion: resourceVersionValue
      selfLink: selfLinkValue
      uid: uidValue
    stringData:
      stringDataKey: stringDataValue
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 08:52:25 UTC 2024
    - 939 bytes
    - Viewed (0)
  9. staging/src/k8s.io/api/testdata/HEAD/core.v1.Secret.yaml

        blockOwnerDeletion: true
        controller: true
        kind: kindValue
        name: nameValue
        uid: uidValue
      resourceVersion: resourceVersionValue
      selfLink: selfLinkValue
      uid: uidValue
    stringData:
      stringDataKey: stringDataValue
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 06 21:25:20 UTC 2022
    - 939 bytes
    - Viewed (0)
  10. src/runtime/string_test.go

    	b.Run("lenruneslice", func(b *testing.B) {
    		for _, sd := range stringdata {
    			b.Run(sd.name, func(b *testing.B) {
    				for i := 0; i < b.N; i++ {
    					sinkInt += len([]rune(sd.data))
    				}
    			})
    		}
    	})
    	b.Run("rangeloop", func(b *testing.B) {
    		for _, sd := range stringdata {
    			b.Run(sd.name, func(b *testing.B) {
    				for i := 0; i < b.N; i++ {
    					n := 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 13 14:05:23 UTC 2022
    - 13.3K bytes
    - Viewed (0)
Back to top