This crate provides the SegVec
data structure.
It is similar to Vec
, but allocates memory in chunks of increasing size, referred to as
"segments". This involves a few trade-offs:
push
operations even if the SegVec
must grow.insert
, remove
, and drain
, are much slower) for a SegVec
than for a Vec
(multiple pointer dereferences, mapping indices to (segment, offset)
pairs)&[T]
or &mut [T]
), though slice
and slice_mut
are availableVec
whose size fluctuates between very large and very small throughout the life of the program.Vec
and would benefit from stable references to the elementsLicense: MIT