- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for GoBytes (0.36 sec)
-
src/runtime/linkname.go
//go:linkname write // used by cgo //go:linkname _cgo_panic_internal //go:linkname cgoAlwaysFalse //go:linkname cgoUse //go:linkname cgoCheckPointer //go:linkname cgoCheckResult //go:linkname cgoNoCallback //go:linkname gobytes //go:linkname gostringn // used in plugin //go:linkname doInit // used in math/bits //go:linkname overflowError //go:linkname divideError // used in tests //go:linkname extraMInUse
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 17:58:53 UTC 2024 - 778 bytes - Viewed (0) -
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) -
src/cmd/cgo/out.go
func _Cfunc_GoStringN(p *_Ctype_char, l _Ctype_int) string { return _cgo_runtime_gostringn(p, int(l)) } ` const goBytesDef = ` //go:linkname _cgo_runtime_gobytes runtime.gobytes func _cgo_runtime_gobytes(unsafe.Pointer, int) []byte // GoBytes converts the C data p with explicit length l to a Go []byte. func _Cfunc_GoBytes(p unsafe.Pointer, l _Ctype_int) []byte { return _cgo_runtime_gobytes(p, int(l)) } `
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 29 16:41:10 UTC 2024 - 59.6K bytes - Viewed (0) -
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) -
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) -
platforms/core-runtime/serialization/src/test/groovy/org/gradle/internal/serialize/DefaultSerializerRegistryTest.groovy
def serializer = registry.build(Number) expect: serialize(123L, serializer) == 123L serialize(123, serializer) == 123 toBytes(123L, serializer).length == toBytes(123L, longSerializer).length + 1 } def "does not write type tag when there is only one matching registered type"() { given: def registry = new DefaultSerializerRegistry()
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Mon Apr 15 16:06:56 UTC 2024 - 6.2K bytes - Viewed (0) -
platforms/core-runtime/serialization/src/testFixtures/groovy/org/gradle/internal/serialize/SerializerSpec.groovy
KryoBackedEncoder } Class<? extends AbstractDecoder> getDecoder() { KryoBackedDecoder } <T> T serialize(T value, Serializer<T> serializer) { def bytes = toBytes(value, serializer) return fromBytes(bytes, serializer) } /** * Serializes and deserializes the given value, asserting that the generated byte sequence is shorter than it would be when default
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Mon Apr 15 16:06:56 UTC 2024 - 2.3K bytes - Viewed (0) -
testing/internal-performance-testing/src/main/groovy/org/gradle/performance/results/PrettyCalculator.groovy
import org.gradle.performance.measure.DataAmount import org.gradle.performance.measure.Duration import java.math.RoundingMode @CompileStatic class PrettyCalculator { static String toBytes(Amount<DataAmount> bytes) { return bytes.toUnits(DataAmount.BYTES).value.setScale(3, RoundingMode.HALF_UP).stripTrailingZeros().toString() + " B" } static String toMillis(Amount<Duration> duration) {
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Apr 04 07:21:38 UTC 2024 - 1.6K bytes - Viewed (0) -
platforms/core-runtime/serialization/src/test/groovy/org/gradle/internal/serialize/BaseSerializerFactoryTest.groovy
} def "uses efficient serialization for Paths"() { expect: def serializer = factory.getSerializerFor(Path) def encoded = toBytes(Paths.get("some-file"), serializer) fromBytes(encoded, serializer) == Paths.get("some-file") encoded.length == 10 } def "uses efficient serialization for Long"() { expect:
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Mon Apr 15 16:06:56 UTC 2024 - 2.9K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"IfData.Lastchange", Field, 0}, {"IfData.Link_state", Field, 0}, {"IfData.Mclpool", Field, 2}, {"IfData.Metric", Field, 0}, {"IfData.Mtu", Field, 0}, {"IfData.Noproto", Field, 0}, {"IfData.Obytes", Field, 0}, {"IfData.Oerrors", Field, 0}, {"IfData.Omcasts", Field, 0}, {"IfData.Opackets", Field, 0}, {"IfData.Pad", Field, 2}, {"IfData.Pad_cgo_0", Field, 2},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0)