1
0
Fork 0
mirror of https://github.com/ii64/gouring.git synced 2025-04-26 05:42:48 +02:00

ring: big cqe support

This commit is contained in:
Xeffy Chen 2022-10-25 15:36:16 +07:00
parent 56c528fe00
commit 8dea91c509
Signed by: Xeffy
GPG key ID: E41C08AD390E7C49
2 changed files with 16 additions and 2 deletions

5
hdr.go
View file

@ -17,8 +17,9 @@ import (
*/
type IoUringSqe_Union1 uint64
func (u *IoUringSqe_Union1) SetOffset(v uint64) { *u = IoUringSqe_Union1(v) }
func (u *IoUringSqe_Union1) SetAddr2(v uint64) { *u = IoUringSqe_Union1(v) }
func (u *IoUringSqe_Union1) SetOffset(v uint64) { *u = IoUringSqe_Union1(v) }
func (u *IoUringSqe_Union1) SetOffset_RawPtr(v unsafe.Pointer) { *u = IoUringSqe_Union1((uintptr)(v)) }
func (u *IoUringSqe_Union1) SetAddr2(v uint64) { *u = IoUringSqe_Union1(v) }
type IoUringSqe_Union2 uint64

13
hdr_extra.go Normal file
View file

@ -0,0 +1,13 @@
package gouring
import (
"unsafe"
)
/*
* If the ring is initialized with IORING_SETUP_CQE32, then this field
* contains 16-bytes of padding, doubling the size of the CQE.
*/
func (cqe *IoUringCqe) GetBigCqe() *[2]uint64 {
return (*[2]uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(cqe)) + SizeofIoUringSqe))
}