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

struct Rav1dFrameData::{cur,prev}_segmap: Arcify with an Option<DisjointMutArcSlice<u8>> #971

Merged
merged 6 commits into from
Apr 17, 2024

Conversation

kkysen
Copy link
Collaborator

@kkysen kkysen commented Apr 13, 2024

To do this, I first added a few things to DisjointMut:

  • e495e00: Allowing T: ?Sized so DisjointMut<[_]> is possible. This didn't really require any changes other than expanding the bounds.
  • e495e00: impl AsMutPtr for [_]
  • 631ce49: impl AsMutPtr for Box<[_]>
  • 704fe93: add fn DisjointMut::new to create a non-default() DisjointMut from a pre-existing T
  • 712c759: Add DisjointMutArcSlice, which is an Arc<DisjointMut<[_]>> in release mode, and an Arc<DisjointMut<Box<[_]>>> in debug mode. In release mode, DisjointMut is #[repr(transparent)], so we can do this and safe allocations and indirections. And in debug mode, the overhead is fine.

Then this Arcifies the segmaps with the above DisjointMutArcSlice<u8>.

@kkysen kkysen force-pushed the kkysen/segmap-Arc branch 2 times, most recently from c7f9b38 to 5a45af6 Compare April 13, 2024 11:08
@kkysen kkysen force-pushed the kkysen/struct-Bounds-simplify-DisjointMut branch from 2ac10fe to 5013571 Compare April 13, 2024 11:18
@kkysen kkysen force-pushed the kkysen/segmap-Arc branch 3 times, most recently from 2490d88 to 640058f Compare April 13, 2024 11:58
@kkysen kkysen changed the title struct Rav1dContext_refs::{,cur_,prev_}segmap: Arcify with an Option<DisjointMutArcSlice> struct Rav1dFrameData::{cur,prev}_segmap: Arcify with an Option<DisjointMutArcSlice<u8>> Apr 13, 2024
src/decode.rs Outdated Show resolved Hide resolved
@kkysen kkysen force-pushed the kkysen/struct-Bounds-simplify-DisjointMut branch from 5013571 to 2dcff75 Compare April 16, 2024 07:14
@kkysen kkysen force-pushed the kkysen/struct-Bounds-simplify-DisjointMut branch from 2dcff75 to ae88ac6 Compare April 16, 2024 07:55
@kkysen kkysen force-pushed the kkysen/struct-Bounds-simplify-DisjointMut branch from ae88ac6 to e3b8f4f Compare April 16, 2024 07:59
@kkysen kkysen changed the base branch from kkysen/struct-Bounds-simplify-DisjointMut to kkysen/struct-RefMvsFrame-r-DisjointMut April 16, 2024 08:02
@kkysen kkysen force-pushed the kkysen/struct-RefMvsFrame-r-DisjointMut branch 2 times, most recently from 626c721 to ca5296d Compare April 16, 2024 19:41
@kkysen kkysen force-pushed the kkysen/struct-RefMvsFrame-r-DisjointMut branch from ca5296d to 09c4e25 Compare April 17, 2024 00:09
Base automatically changed from kkysen/struct-RefMvsFrame-r-DisjointMut to main April 17, 2024 00:17
@kkysen kkysen merged commit 85da63c into main Apr 17, 2024
19 checks passed
@kkysen kkysen deleted the kkysen/segmap-Arc branch April 17, 2024 00:32
kkysen added a commit that referenced this pull request Apr 19, 2024
This fixes a bug from #971 where I was overslicing. It wasn't caught by
the normal tests, only the argon tests that only ran on `main` once I
merged.
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