1 unstable release
0.1.0 | Nov 12, 2021 |
---|
#919 in Concurrency
Used in hv-cell
8KB
77 lines
Heavy Lease-Tracker - tracking of borrow origins for diagnostics of runtime borrow failures
LeaseTracker
implements a simple system using guards and the Rust core::panic::Location
API to
track and provide information on the source locations of borrows for when interior mutability
primitives you write fail.
no-std
compatible; uses alloc
for Arc
and spinlocks for very short critical sections.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
Heavy Lease Tracker - functionality for tracking borrows and providing more helpful errors on runtime borrowing/aliasing violations.
LeaseTracker
type, for use in smart cells likehv-cell
'sAtomicRefCell
(only on debug withtrack-leases
feature enabled)Lease
type, for use in smart references/guard types likehv-cell
'sAtomicRef
/AtomicRefMut
andArcRef
/ArcRefMut
OpenLease
type, representing the origin of a dynamic borrow for diagnostic usage
no_std
compatible, but requires alloc
for Arc
s, Cow
s, and String
s and uses spinlocks
internally to LeaseTracker
for synchronizing adding/removing OpenLease
s.
hv-lease-tracker
is not a super performant crate, and should probably be disabled in your
release builds if performance of borrows is critical. It is strictly for diagnostic info.
Dependencies
~190KB