Remove atomic64
feature and use crossbeam::atomic::AtomicCell<u64>
for all targets?
#41
Labels
enhancement
New feature or request
In order to support target platforms without
AtomicU64
, we added a Cargo feature calledatomic64
to Moka v0.5.3 and put it into the default feature list (#38, #39).AtomicU64
as timestamps of cache entries).RwLock<Instant>
so that it will compile for such targets.The feature also controls whether quanta crate is used or not by Moka, because quanta v0.9.2 or earlier do not compile for such targets.
We might want to replace above with
crossbeam::atomic::AtomicCell<u64>
because it provides a similar functionality toAtomicU64
(when it is supported by the target) andRwLock<u64>
(whenAtomicU64
is not supported).https://docs.rs/crossbeam/0.8.1/crossbeam/atomic/struct.AtomicCell.html
It will be more convenient as it switches implementations without having a Cargo feature like
atomic64
. It combines auto-generated Rust source and the build script to achieve auto-switching.Also, the next version of quanta will support these targets (metrics-rs/quanta#55), so once it is released, we can always enable quanta.
The text was updated successfully, but these errors were encountered: