mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 23:52:31 +00:00
io_uring: fix copy_cqes logic
This commit is contained in:
parent
631c28c9e3
commit
704660c81a
@ -284,7 +284,7 @@ fn copy_cqes_ready(self: *IoUring, cqes: []linux.io_uring_cqe) u32 {
|
||||
const head = self.cq.head.* & self.cq.mask;
|
||||
const tail = (self.cq.head.* +% count) & self.cq.mask;
|
||||
|
||||
if (head <= tail) {
|
||||
if (head < tail) {
|
||||
// head behind tail -> no wrapping
|
||||
@memcpy(cqes[0..count], self.cq.cqes[head..tail]);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user