-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…662) This eliminates the only mutation of `Rav1dFrameHeader`, thus allowing it to be stored in an `Arc` without any borrowck problems. This uses the [`atomig`](https://docs.rs/atomig) crate to make the `[i16; 4]` field atomic. The crate is quite simple, offering an `Atomic<T>` type that can only be implemented for actually lock-free atomic types through a simple `pack` and `unpack` into an atomic type (`u64` in this case for `[i16; 4]`). The alternatives would to use the [`atomic`](https://docs.rs/atomic) crate, which also offers an `Atomic<T>`, but doesn't guarantee a lock-free implementation, and whose implementation seems more complex. The other alternative would be to basically recreate what `atomig` is doing of packing and unpacking into an `u64` for atomic operations, so I think using the existing `atomig` crate is simpler. Update: I replaced `atomig` with an inline solution of about the same complexity.
- Loading branch information
Showing
5 changed files
with
71 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters