#[cfg(feature = "debug_atomic_refcell")] ?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 32/100
Research direction
Start by comparing this crate's thread-safe RefCell implementation with the original RefCell implementation and its debug_refcell feature. Determine whether borrowed_at information can be retained safely, then define the debug-build behavior and verify that borrow errors report the earliest active borrow location without compromising multi-threaded use.
Written by the indexing model from the issue text.
Description
In the original RefCell implementation there is a cfg feature called "debug_refcell", which in case of a panic allows to see where a RefCell was first borrowed:
pub struct RefCell<T: ?Sized> {
borrow: Cell<BorrowFlag>,
// Stores the location of the earliest currently active borrow.
// This gets updated whenever we go from having zero borrows
// to having a single borrow. When a borrow occurs, this gets included
// in the generated `BorrowError/`BorrowMutError`
#[cfg(feature = "debug_refcell")]
borrowed_at: Cell<Option<&'static crate::panic::Location<'static>>>,
value: UnsafeCell<T>,
}
I read that you stripped RefCell of everything that conflicted multi-thread environment. Is it because of this that the debug feature was removed? Is it hard to reimplement it back? Pushing borrow checking into runtime leaves us with less info to investigate things. This leads projects like accountable-refcell to store the whole stack trace per RefCell. Well, that much of an overhead is probably overkill, but to have the minimal "borrowed_at" info is an essential thing to have for debug builds, don't you think?🤔
- Dominant language
- Rust
- Stars
- 103
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mozilla/atomic_refcell
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
mozilla/atomic_refcell#38 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
mozilla/atomic_refcell#32 ·
-
AtomicWeakRef Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
mozilla/atomic_refcell#26 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
mozilla/atomic_refcell#11 · 7 comments ·
All issues in mozilla/atomic_refcell
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug team:backend track:services-maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cowprotocol/services#4950 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·