4 ms·
Could not find any unsafe usage in Ian Jackson's, and it depends on no other crates. https://lib.rs/crates/rc-dlist-deque https://lib.rs/crates/rc-dlist-deque
by CameronNemo 7y ago
Could not find any unsafe usage in Ian Jackson's, and it depends on no other crates.
https://lib.rs/crates/rc-dlist-deque https://lib.rs/crates/rc-dlist-deque
- CJefferson 7y agoOK, perhaps we should say a doubly-linked list where each node contains the data and two pointers. While this is safe, it's also fairly inefficient, storing an extra counter with every node, which are dynamically updated, just to keep the borrow checker happy.
- steveklabnik 7y agoThe word you're looking for is "intrusive".
- CJefferson 7y agoNope, intrusive is different. Because this is using an Rc (reference counted pointer) for the forward and backward pointers, these counters are both set to '2', as (almost) everything in a doubly-linked list has two things pointing to it, the thing after and the thing before.
- steveklabnik 7y agoI'm saying you're asking for intrusive ("each node contains the data and two pointers") whereas this list is not intrusive.