memorysafety / rav1d

An AV1 decoder in Rust.
BSD 2-Clause "Simplified" License
248 stars 17 forks source link

Make `Rav1dPicAllocator` fully safe #1009

Open kkysen opened 4 months ago

kkysen commented 4 months ago

This should be possible, leaving the only unsafe in the Dav1dPicAllocator conversions, but it's fairly tricky, so we can save it for later.

rinon commented 1 month ago

Is this done now?

kkysen commented 1 month ago

Is this done now?

No. I wasn't planning on doing this unless someone wanted it. The current API is unsafe, while what this issue suggested was a rewrite to make the API fully safe from Rust.

rinon commented 1 month ago

Ah I see, I think that could go along with a safe Rust API, if you're only using the C API then would it even make sense to try to make this fully safe?

kkysen commented 1 month ago

Ah I see, I think that could go along with a safe Rust API, if you're only using the C API then would it even make sense to try to make this fully safe?

Yeah that would make sense to go together. You're right, the C API wouldn't get safer from this (though internally we'd use the Rust API for the default, and that's what usually used).