Skip to content

Use a pointer-width atomic for status cache generation - #3057

Open
imshah-id wants to merge 1 commit into
gitui-org:masterfrom
imshah-id:fix/portable-status-generation
Open

imshah-id wants to merge 1 commit into
gitui-org:masterfrom
imshah-id:fix/portable-status-generation

Conversation

@imshah-id

Copy link
Copy Markdown

Fixes #3045.

Use a pointer-width atomic for the status cache's private generation counter. The counter changes the key for the next status request. It is never serialized or exposed as a public value, and the request hash keeps its u64 type.

Validation

  • cargo fmt --all -- --check and cargo test --locked -p asyncgit passed on macOS arm64 (177 unit tests and one doctest).
  • A focused compile probe using the counter operations fails with the original AtomicU64 import and compiles with AtomicUsize for armv5te-unknown-linux-gnueabi. The full GitUI application was not cross-built.
  • Added an unreleased changelog entry.

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.

Unconditional usage of 8-byte atomics breaks 32-bit build: status.rs: error:0: Unable to resolve use target ::"std-0_0_0"::sync::atomic::AtomicU64/*?*/

1 participant