Skip to content

Add an epoll::wait_uninit.#1309

Closed
sunfishcode wants to merge 5 commits intomainfrom
sunfishcode/epoll-uninit
Closed

Add an epoll::wait_uninit.#1309
sunfishcode wants to merge 5 commits intomainfrom
sunfishcode/epoll-uninit

Conversation

@sunfishcode
Copy link
Member

This is like epoll::wait, except that it can read into an uninitialized buffer, and it returns a pair of slices, similar to read_uninit. This also means it doesn't require "alloc".

This is a possible alternative direction to #1290. I'm on the fence still. I like some things about the Buffer trait magic, including how it can encapsulate the unsafety of the set_len to resize a Vec to the number of initialized bytes. However, I don't like how it seems to feel more magical than it is. In read(fd, extend(&mut v)), you still have to think about end-of-stream, EINTR, short reads, and spare capacity.

This is like `epoll::wait`, except that it can read into an
uninitialized buffer, and it returns a pair of slices, similar to
`read_uninit`. This also means it doesn't require "alloc".
@sunfishcode sunfishcode force-pushed the sunfishcode/epoll-uninit branch from d3c86be to 3360853 Compare February 14, 2025 19:20
@sunfishcode
Copy link
Member Author

Closing in favor of #1290, which I'm feeling more confident in now.

@sunfishcode sunfishcode deleted the sunfishcode/epoll-uninit branch February 25, 2025 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant