- Backport of fix to soundness issue in #45 (access::Map from Constant can lead to dangling references).
- Rename the
unstable-weak
toweak
feature. The support is now available on 1.45 (currently in beta).
- Adjust to
Weak::as_ptr
from std (the weak pointer support, relying on unstable features). - Support running on miri (without some optimizations), so dependencies may run miri tests.
- Little optimization when waiting out the contention on write operations.
- Added
Guard::from_inner
.
- Top-level docs rewrite (less rambling, hopefully more readable).
- Fix the
Display
implementation onGuard
to correctly delegate to the underlyingDisplay
implementation.
- The Access functionality ‒ ability to pass a handle to subpart of held data to somewhere with the ability to update itself.
- Mapped cache can take
FnMut
as well asFn
.
- Mapped caches ‒ to allow giving access to parts of config only.
- Support for Weak pointers.
- RefCnt implemented for Rc.
- Breaking: Big API cleanups.
- Peek is gone.
- Terminology of getting the data unified to
load
. - There's only one kind of
Guard
now. - Guard derefs to the
Arc
/Option<Arc>
or similar. Cache
got moved to top level of the crate.- Several now unneeded semi-internal traits and trait methods got removed.
- Splitting benchmarks into a separate sub-crate.
- Minor documentation improvements.
- Prevention against UB due to dropping Guards and overflowing the guard counter (aborting instead, such problem is very degenerate anyway and wouldn't work in the first place).
- Tweak slot allocation to take smaller performance hit if some leases are held.
- Increase the number of lease slots per thread to 8.
- Added a cache for faster access by keeping an already loaded instance around.
- Fix Send/Sync for Guard and Lease (they were broken in the safe but uncomfortable direction ‒ not implementing them even if they could).
Lease<Option<_>>::unwrap()
,expect()
andinto_option()
for convenient use.
- Use the correct
#[deprecated]
syntax.
- Another locking store (
PrivateSharded
) to complement the global and private unsharded ones. - Comparison to other crates/approaches in the docs.
- Updates to documentation, made it hopefully easier to digest.
- Added the ability to separate gen-locks of one ArcSwapAny from others.
- Some speed improvements by inlining.
- Simplified the
lease
method internally, making it faster in optimistic cases.
- Another potentially weak ordering discovered (with even less practical effect than the previous).
- Increased potentially weak ordering (probably without any practical effect).
- Documentation link fix.
- Few convenience constructors.
- More tests (some randomized property testing).
compare_and_swap
no longer takes&Guard
as current as that is a sure way to create a deadlock.- Introduced
Lease
for temporary storage, which doesn't suffer from contention likeload
, but doesn't block writes likeGuard
. The downside is it slows down with number of held by the current thread. compare_and_swap
andrcu
uses leases.- Made the
ArcSwap
as small as the pointer itself, by making the shards/counters and generation ID global. This comes at a theoretical cost of more contention when different threads use different instances.
- Added an
ArcSwapOption
, which allows storing NULL values (as None) as well as a valid pointer. compare_and_swap
accepts borrowedArc
ascurrent
and doesn't consume one ref count.- Sharding internal counters, to improve performance on read-mostly contented scenarios.
- Providing
peek_signal_safe
as the only async signal safe method to use inside signal handlers. This removes the footgun with dropping theArc
returned fromload
inside a signal handler.
- The
peek
method to use theArc
inside without incrementing the reference count. - Some more (and hopefully better) benchmarks.
- Documentation fix (swap is not lock-free in current implementation).
- More freedom in the
rcu
andrcu_unwrap
return types.
rcu
support.compare_and_swap
support.- Added some primitive benchmarks.
- Initial implementation.