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
When creating large trees, inserting many nodes causes the underlying Vec to reallocate frequently. Arena::with_capacity would simply create allocate the Vec beforehand.
I would also suggest adding the Arena::clear function which simply clears the Vec, causing all the created NodeIds to be invalid.
This is equivalent to removing all the Nodes while retaining the Vec capacity.
Unless I forgot something, I'm rather confident that such an implementation would not cause soundness issues, e.g. with the iterators.
The text was updated successfully, but these errors were encountered:
When creating large trees, inserting many nodes causes the underlying
Vec
to reallocate frequently.Arena::with_capacity
would simply create allocate theVec
beforehand.I would also suggest adding the
Arena::clear
function which simply clears theVec
, causing all the createdNodeId
s to be invalid.This is equivalent to removing all the
Node
s while retaining theVec
capacity.Unless I forgot something, I'm rather confident that such an implementation would not cause soundness issues, e.g. with the iterators.
The text was updated successfully, but these errors were encountered: