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

mod picture: Make fully safe #1006

Merged
merged 3 commits into from
May 1, 2024
Merged

mod picture: Make fully safe #1006

merged 3 commits into from
May 1, 2024

Conversation

kkysen
Copy link
Collaborator

@kkysen kkysen commented Apr 26, 2024

Copy link
Collaborator

@randomPoison randomPoison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can mark dav1d_default_picture_alloc and dav1d_default_picture_release as safe, they have unsafe preconditions that the caller needs to uphold in order to prevent UB. I think doing deny(unsafe_op_in_unsafe_fn) and calling out those safety requirements in the code is good, though.

@kkysen
Copy link
Collaborator Author

kkysen commented Apr 26, 2024

I don't think we can mark dav1d_default_picture_alloc and dav1d_default_picture_release as safe, they have unsafe preconditions that the caller needs to uphold in order to prevent UB. I think doing deny(unsafe_op_in_unsafe_fn) and calling out those safety requirements in the code is good, though.

Oh yeah, true.

Base automatically changed from kkysen/struct-MemPool to main May 1, 2024 07:15
@kkysen kkysen merged commit 12e9dc6 into main May 1, 2024
21 checks passed
@kkysen kkysen deleted the kkysen/mod-picture-safe branch May 1, 2024 07:15
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.

picture.rs: Unsafe cleanup
2 participants