Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for GoBytes (0.64 sec)

  1. src/runtime/string.go

    	}
    
    	*(*slice)(unsafe.Pointer(&b)) = slice{p, size, int(mem / 4)}
    	return
    }
    
    // used by cmd/cgo
    func gobytes(p *byte, n int) (b []byte) {
    	if n == 0 {
    		return make([]byte, 0)
    	}
    
    	if n < 0 || uintptr(n) > maxAlloc {
    		panic(errorString("gobytes: length out of range"))
    	}
    
    	bp := mallocgc(uintptr(n), nil, false)
    	memmove(bp, unsafe.Pointer(p), uintptr(n))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:17:26 UTC 2024
    - 13.4K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/staticdata/data.go

    		info.Name = file
    		info.Size = size
    	}
    
    	return symdata, size, nil
    }
    
    var slicedataGen int
    
    func slicedata(pos src.XPos, s string) *obj.LSym {
    	slicedataGen++
    	symname := fmt.Sprintf(".gobytes.%d", slicedataGen)
    	lsym := types.LocalPkg.Lookup(symname).LinksymABI(obj.ABI0)
    	off := dstringdata(lsym, 0, s, pos, "slice")
    	objw.Global(lsym, int32(off), obj.NOPTR|obj.LOCAL)
    
    	return lsym
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:08:50 UTC 2023
    - 10.3K bytes
    - Viewed (0)
  3. src/cmd/cgo/internal/test/test.go

    	Name      string
    	Got, Want interface{}
    }
    
    var testPairs = []testPair{
    	{"GoString", C.GoString(C.greeting), greeting},
    	{"GoStringN", C.GoStringN(C.greeting, 5), greeting[:5]},
    	{"GoBytes", C.GoBytes(unsafe.Pointer(C.greeting), 5), []byte(greeting[:5])},
    }
    
    func testHelpers(t *testing.T) {
    	for _, pair := range testPairs {
    		if !reflect.DeepEqual(pair.Got, pair.Want) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 48.5K bytes
    - Viewed (0)
  4. src/cmd/cgo/doc.go

    	// C string to Go string
    	func C.GoString(*C.char) string
    
    	// C data with explicit length to Go string
    	func C.GoStringN(*C.char, C.int) string
    
    	// C data with explicit length to Go []byte
    	func C.GoBytes(unsafe.Pointer, C.int) []byte
    
    As a special case, C.malloc does not call the C library malloc directly
    but instead calls a Go helper function that wraps the C library malloc
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 17:12:16 UTC 2024
    - 42.2K bytes
    - Viewed (0)
  5. internal/s3select/sql/value.go

    	return
    }
    
    // ToTimestamp returns the timestamp value if present.
    func (v Value) ToTimestamp() (t time.Time, ok bool) {
    	t, ok = v.value.(time.Time)
    	return
    }
    
    // ToBytes returns the value if byte-slice.
    func (v Value) ToBytes() (val []byte, ok bool) {
    	val, ok = v.value.([]byte)
    	return
    }
    
    // ToArray returns the value if it is a slice of values.
    func (v Value) ToArray() (val []Value, ok bool) {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Feb 25 20:31:19 UTC 2022
    - 20.2K bytes
    - Viewed (0)
  6. platforms/software/dependency-management/src/test/groovy/org/gradle/api/internal/artifacts/ivyservice/resolveengine/result/ComponentSelectorSerializerTest.groovy

                DefaultModuleIdentifier.newId('group3', 'name3'), constraint('1.0'), factory.of(attr, "val1"), [])
    
            when:
            byte[] result1 = toBytes(selector1, serializer)
            byte[] result2 = toBytes(selector2, serializer)
            byte[] result3 = toBytes(selector3, serializer)
    
            then:
            result2.length == result1.length // different attributes
            result3.length < result1.length // already seen
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 11.8K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go

    	t.Parallel()
    
    	// needs to be large to force allocations so we pick a random value between [1024, 2048]
    	size := utilrand.IntnRange(1024, 2048+1)
    
    	t.Run("toBytes semantics", func(t *testing.T) {
    		t.Parallel()
    
    		s := utilrand.String(size)
    		b := toBytes(s)
    		if len(b) != size {
    			t.Errorf("unexpected length: %d", len(b))
    		}
    		if cap(b) != size {
    			t.Errorf("unexpected capacity: %d", cap(b))
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 20.3K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope.go

    		b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) {
    			b.AddBytes(toBytes(k))
    		})
    		b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) {
    			b.AddBytes(annotations[k])
    		})
    	}
    
    	return b.Bytes()
    }
    
    // toBytes performs unholy acts to avoid allocations
    func toBytes(s string) []byte {
    	// unsafe.StringData is unspecified for the empty string, so we provide a strict interpretation
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 27 00:23:50 UTC 2023
    - 18.7K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go

    	Unused1    uint8
    	Mtu        uint32
    	Metric     uint32
    	Baudrate   uint32
    	Ipackets   uint32
    	Ierrors    uint32
    	Opackets   uint32
    	Oerrors    uint32
    	Collisions uint32
    	Ibytes     uint32
    	Obytes     uint32
    	Imcasts    uint32
    	Omcasts    uint32
    	Iqdrops    uint32
    	Noproto    uint32
    	Recvtiming uint32
    	Xmittiming uint32
    	Lastchange Timeval32
    	Unused2    uint32
    	Hwassist   uint32
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 12.4K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go

    	Unused1    uint8
    	Mtu        uint32
    	Metric     uint32
    	Baudrate   uint32
    	Ipackets   uint32
    	Ierrors    uint32
    	Opackets   uint32
    	Oerrors    uint32
    	Collisions uint32
    	Ibytes     uint32
    	Obytes     uint32
    	Imcasts    uint32
    	Omcasts    uint32
    	Iqdrops    uint32
    	Noproto    uint32
    	Recvtiming uint32
    	Xmittiming uint32
    	Lastchange Timeval32
    	Unused2    uint32
    	Hwassist   uint32
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 12.4K bytes
    - Viewed (0)
Back to top