Lines Matching refs:buf
25 func buf_ref(buf []byte) C.uintptr_t {
26 if len(buf) == 0 {
30 return C.uintptr_t(uintptr(unsafe.Pointer(&buf[0])))
44 func (buf *cbuf) init_bytes(b []byte) {
45 buf.b = buf_ref(b)
46 buf.s = C.size_t(len(b))
55 func (buf *cbuf) GoBytes() []byte {
56 if buf == nil {
62 Data: unsafe.Pointer(uintptr(buf.b)),
63 Len: int(buf.s),
64 Cap: int(buf.s),
70 func GoBytes(buf unsafe.Pointer, size C.int) []byte {
72 Data: buf,