-
Notifications
You must be signed in to change notification settings - Fork 131
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
lib: make register_buffers
unsafe
#219
Conversation
BREAKING CHAMGE: this is required as incorrect inputs may introduce undefined behaviour. Please see the "Safety" section of the `Submitter::register_buffers` documentation for more information about safety requirements.
I don't mind the breaking change and you raise a good point for a crate that wants to be sound. Could you provide a Safety comment that was more in the affirmative of what the caller has to do to maintain the safety contract? Saying it should not be used improperly is more vague than other tokio-maintained unsafe comments. |
I've tweaked the message to match the one on |
Yes, looks better to me. @quininer is in a different timezone. Have to wait for their review. |
This makes sense. I will release a 0.6-pre first so that I can merge other break changes in the meantime. |
I noticed that |
Yes. I can see the value in making those changes now too. You think the ring_addr type should be made |
|
Checkout PR 221. I didn't include a type change because as the test code shows, a user of the library is not always really starting with a BufRingEntry array or vector and casting to a u64 is more directly what the io_uring API calls for. But I'm on the fence. If you want it, I will do that too. I'm just not sure so wanted you to take a second look first. |
This breaking change is required as calling
register_buffers
with incorrect inputs may introduce undefined behaviour.This PR also changes the method documentation to use
fixed buffers
instead ofuser buffers
to match theio_uring
man pages terminology, related to #217.