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
This is an enhancement suggestion. Most times I want to use a SmallVec I don't need a huge number of cells, most times it's quite short. On the other hand saving some memory is often useful (an usage case of SmallVec for me is for 2D arrays of dynamic vectors, where most cells of the 2D matrix contain only very few items). So I think using a u32 for both capacity and length of the SmallVec could be enough (like in the Vec32 crate). It could be another cargo feature. Here SmallVec2 is a union of structs, both structs have fields in locked position (repr C), and both start with the capacity. This is less safe than the current design (of SmallVec1).
This is an enhancement suggestion. Most times I want to use a SmallVec I don't need a huge number of cells, most times it's quite short. On the other hand saving some memory is often useful (an usage case of SmallVec for me is for 2D arrays of dynamic vectors, where most cells of the 2D matrix contain only very few items). So I think using a u32 for both capacity and length of the SmallVec could be enough (like in the Vec32 crate). It could be another cargo feature. Here SmallVec2 is a union of structs, both structs have fields in locked position (repr C), and both start with the capacity. This is less safe than the current design (of SmallVec1).
The text was updated successfully, but these errors were encountered: