You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason why we require K: 'static and V: 'static on methods that remove elements is that removed nodes are added to the global epoch-based garbage collector. Nodes in the GC's garbage queue might get destroyed very late in the future, potentially after the skip list itself is dropped. If K or V hold any references, their destructors must be called before those references expire, hence the very conservative 'static bounds.
We can remove the 'static bounds only if we somehow guarantee that all garbage nodes added to the GC are destroyed before the parent skip list is dropped.
The easiest way to solve the problem is probably to create a new Collector in SkipList::new so that each skip list owns its GC, which gets dropped together with the skip list (dropping a GC destroys all remaining garbage in it).
The text was updated successfully, but these errors were encountered:
ghost
transferred this issue from crossbeam-rs/crossbeam-skiplist
Nov 5, 2018
The reason why we require
K: 'static
andV: 'static
on methods that remove elements is that removed nodes are added to the global epoch-based garbage collector. Nodes in the GC's garbage queue might get destroyed very late in the future, potentially after the skip list itself is dropped. IfK
orV
hold any references, their destructors must be called before those references expire, hence the very conservative'static
bounds.We can remove the
'static
bounds only if we somehow guarantee that all garbage nodes added to the GC are destroyed before the parent skip list is dropped.The easiest way to solve the problem is probably to create a new
Collector
inSkipList::new
so that each skip list owns its GC, which gets dropped together with the skip list (dropping a GC destroys all remaining garbage in it).The text was updated successfully, but these errors were encountered: