- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for GoBytes (0.09 sec)
-
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/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)