Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an epoll::wait_uninit. #1309

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

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".
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