Is there crate for segmented vector?

I wanta Vec like API but without guarantee of continuity in memory.

It should store first X elements in a fixed size array inside, and everything that spilled over should be in heap. Kind of how GermanString works.

Thanks.

Not exactly what you want I guess, but it allows you to start small on the stack and move to the heap as the vector grows.

You can also implement such a structure yourself:

Of course there's room for optimizations.

Yes, I would need something like second option.

Btw, what the advantages of using heapless::Vec compared to ArrayVec?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.