1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Remove 64 bit atomics in main crate (#8037)

This allows the base egui crate to run on platforms without 64 bit
atomics

* Addresses <https://github.com/emilk/egui/issues/7692>, but does not
address the `egui_extras` crate

* [x] I have followed the instructions in the PR template
This commit is contained in:
kay-lambdadelta
2026-05-12 04:46:22 -07:00
committed by GitHub
parent 4a8618498e
commit 2925b465c2
2 changed files with 26 additions and 19 deletions

View File

@@ -3,7 +3,7 @@ use std::{
collections::BTreeMap,
sync::{
Arc,
atomic::{AtomicU64, Ordering},
atomic::{AtomicUsize, Ordering},
},
};
@@ -439,7 +439,7 @@ impl FontFaceKey {
pub const INVALID: Self = Self(0);
fn new() -> Self {
static KEY_COUNTER: AtomicU64 = AtomicU64::new(1);
static KEY_COUNTER: AtomicUsize = AtomicUsize::new(1);
Self(crate::util::hash(
KEY_COUNTER.fetch_add(1, Ordering::Relaxed),
))