Cgo add cbytes implementation (rebased version of #3318) (#4470)

cgo: added CBytes implementation
This commit is contained in:
leongross
2024-09-17 07:12:57 -07:00
committed by GitHub
parent d4729f92bd
commit a9bf981d92
10 changed files with 61 additions and 1 deletions
+7
View File
@@ -24,6 +24,13 @@ func C.GoBytes(ptr unsafe.Pointer, length C.int) []byte {
return C.__GoBytes(ptr, uintptr(length))
}
//go:linkname C.__CBytes runtime.cgo_CBytes
func C.__CBytes([]byte) unsafe.Pointer
func C.CBytes(b []byte) unsafe.Pointer {
return C.__CBytes(b)
}
type (
C.char uint8
C.schar int8