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
I must have looked over the Vec::reserve documentation a dozen times, and somehow I never noticed that it reserves at least self.len() + additional and not self.capacity() + additional, meaning that self.reserve(self.capacity()) can do nothing instead of doubling the capacity. I only now found about this in another project where it caused an unexpected infinite loop. The previous versions of triple_arena happened to be ultimately based on length and never encountered the problem, and in the current version NonZeroInxVec uses the formulation I always assumed was the case. Should I change the behavior of all the reserve functions?
The text was updated successfully, but these errors were encountered:
I must have looked over the
Vec::reserve
documentation a dozen times, and somehow I never noticed that it reserves at leastself.len() + additional
and notself.capacity() + additional
, meaning thatself.reserve(self.capacity())
can do nothing instead of doubling the capacity. I only now found about this in another project where it caused an unexpected infinite loop. The previous versions oftriple_arena
happened to be ultimately based on length and never encountered the problem, and in the current versionNonZeroInxVec
uses the formulation I always assumed was the case. Should I change the behavior of all thereserve
functions?The text was updated successfully, but these errors were encountered: