Skip to content

Commit 690c76f

Browse files
authored
Fix overflow in kqueue backend (#115)
Closes #111 @mitchellh I managed to write a test to avoid regressions but I'm not sure it's deterministic, should I still add it?
2 parents 6afcde9 + a2d9b31 commit 690c76f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/kqueue.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ pub const Loop = struct {
437437
// Only resubmit if we aren't already active (in the queue)
438438
.rearm => if (!c_active) self.submissions.push(c),
439439
}
440+
441+
// If we filled the events slice, we break to avoid overflow.
442+
if (changes == events.len) break;
440443
}
441444

442445
// Determine our next timeout based on the timers

0 commit comments

Comments
 (0)