Ejemplo n.º 1
0
func makeUint32Array(data []byte, n int) []uint32 {
	newdata := make([]uint32, len(data)/4)
	l := C.int(len(data))
	C.rawcopy(unsafe.Pointer(&newdata[0]), l, unsafe.Pointer(&data[0]), l)
	return newdata
}
Ejemplo n.º 2
0
func makePidArray(data []byte, n int) []C.__kernel_pid_t {
	newdata := make([]C.__kernel_pid_t, len(data)/kernel_pid_t_size)
	l := C.int(len(data))
	C.rawcopy(unsafe.Pointer(&newdata[0]), l, unsafe.Pointer(&data[0]), l)
	return newdata
}