Пример #1
0
func (r *VMem) allocGMemAlign(l uint64, a int) *GMem {
	gm := &GMem{key: r.key}
	gm.off = uint64(C.allocMemAlign(r.head, C.int64(l), C.int(a)))
	gm.length = l
	return gm
}
Пример #2
0
func (r *VMem) allocAlign(l uint64, a int) (unsafe.Pointer, error) {
	p := C.allocMemAlign(r.head, C.int64(l), C.int(a))
	return r.mem.getBuf(uint64(p), l)
}