Skip to content

Conversation

@kkysen
Copy link
Collaborator

@kkysen kkysen commented May 27, 2025

Adding proper lifetimes is difficult (see #1317), so we instead make this an unsafe precondition, that buf must outlive the returned Self.

Since all of the uses use lifetime extension to easily guarantee that buf outlives the returned Rav1dPictureDataComponent (with an extended lifetime), I thought I might at least be able to use a macro to do this to encapsulate the unsafe, but it didn't work with lifetime extension. I don't think there's a way. Hopefully, someone can eventually fix #1317 and do this more properly.

This will also help untangle #1327.

…uf` outlives `Self`

Adding proper lifetimes is difficult (see #1317),
so we instead make this an `unsafe` precondition,
that `buf` must outlive the returned `Self`.
@kkysen kkysen requested a review from djc May 27, 2025 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants