INNER CODE UNIT · Go

result

krypton-byte/neonize · goneonize/main.go:400

	result := (*C.struct_BytesReturn)(C.malloc(C.size_t(unsafe.Sizeof(C.struct_BytesReturn{}))))
	result.size = C.size_t(len(data_buf))
	if len(data_buf) > 0 {
		result.data = (*C.char)(C.malloc(result.size))
		C.memcpy(unsafe.Pointer(result.data), unsafe.Pointer(&data_buf[0]), result.size)
	} else {
		result.data = nil
	}
	*bufPtr = data_buf // keep the grown capacity for the next caller
	bufPool.Put(bufPtr)
	return result
}

func getBytesAndSize(data []byte) (*C.char, C.size_t) {
	if len(data) == 0 {
		return nil, 0
	}
	messageSourceCDATA := (*C.char)(unsafe.Pointer(&data[0]))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…