Skip to content

Proof of concept / big rewrite #16

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

Closed
wants to merge 4 commits into from
Closed

Proof of concept / big rewrite #16

wants to merge 4 commits into from

Conversation

Stargateur
Copy link
Contributor

@Stargateur Stargateur commented Mar 18, 2021

Long time ago, I wanted to improve this crate cause I find out the current API doesn't protect from missuses of the union from epoll. I didn't have enough skill in Rust at this time so I started something and give up. But here I come back after a random night of funny work.

What is in this:

  1. A totally safe API (I need to add test but I was codding on windows this night... I use arch BTW)
  2. Not leak proof (see Can't specialize Drop rust-lang/rust#46893)
  3. Fix a potential UB in the current Debug implementation of Event (see Tracking issue for safe_packed_borrows compatibility lint rust-lang/rust#46043)
  4. Reduce the user control of its data
  5. Remove any need for the user to use unsafe (I think I need to add some helper on Event cause the structure is packed. I need to do more search one this (align to 1 ?)
  6. Still a draft
  7. Find a better name for ptr() ?

I probably forgot some, anyway, I would like your thought on this. I know it's a big breaking change but I would like to know if you like this, or if you don't want any of this, and if you have anything to say about that.

@nathansizemore
Copy link
Owner

Thanks for your interest @Stargateur , but this isn't going to be something I'll merge in. Not that it's a bad idea, but it's not really the goal of this crate and would be too major of a breaking change for a crate that's been non-breaking for a while and gets a consistent non-zero amount of downloads/day. This crate is basically at a standstill minus bug fixes and new epoll options.

The goal was to make this as close to the C API as possible. This crate started out way different, but in the end when you're already at the level of wanting to use and manage epoll directly, you're almost certainly using other libc calls in your program to work around how Rust lifetimes and fd duplication works vs how the libc calls handle them. Keeping it similar to other libc calls just makes it all easier to work together.

You should start your own crate test it out, publish, and get some feedback on your version of the implementation!

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.

2 participants