authorgravatar for igor.anic@gmail.comIgor Anić <igor.anic@gmail.com> 2024-03-31 23:52:46+02:00
committergravatar for igor.anic@gmail.comIgor Anić <igor.anic@gmail.com> 2024-03-31 23:52:46+02:00
log704660c81a3e53713645528e658881283af013dd
treee22885e39a974dbdbd4deecdbc5a0fa59ec7a022
parent631c28c9e3814de45b1a55b0d475d41623981dae

io_uring: fix copy_cqes logic


1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/os/linux/IoUring.zig+1-1
...@@ -284,7 +284,7 @@ fn copy_cqes_ready(self: *IoUring, cqes: []linux.io_uring_cqe) u32 {...@@ -284,7 +284,7 @@ fn copy_cqes_ready(self: *IoUring, cqes: []linux.io_uring_cqe) u32 {
284 const head = self.cq.head.* & self.cq.mask;284 const head = self.cq.head.* & self.cq.mask;
285 const tail = (self.cq.head.* +% count) & self.cq.mask;285 const tail = (self.cq.head.* +% count) & self.cq.mask;
286286
287 if (head <= tail) {287 if (head < tail) {
288 // head behind tail -> no wrapping288 // head behind tail -> no wrapping
289 @memcpy(cqes[0..count], self.cq.cqes[head..tail]);289 @memcpy(cqes[0..count], self.cq.cqes[head..tail]);
290 } else {290 } else {