mitchellh / libxev

libxev is a cross-platform, high-performance event loop that provides abstractions for non-blocking IO, timers, events, and more and works on Linux (io_uring or epoll), macOS (kqueue), and Wasm + WASI. Available as both a Zig and C API.
MIT License
2.07k stars 74 forks source link

io_uring: fix noop handling #31

Closed Corendos closed 1 year ago

Corendos commented 1 year ago

Description

noop operations were causing a panic when other completions were active. This was due to the user_data field of the io_uring_cqe being null when being converted to a *Completion in the tick_() function.

Note to reviewers

I tried to go for the simplest solution there. A cast to ?*Completion is attempted and the loop continues if it is null.