News for hackers. Stuff that matters.
Re:Rust 1.51 by zackees on Thursday March 25, 2021 @02:08PM (#26583451)
One of my favorite data structures in C++ is InlineVector<T,N>. If the number of elements is <= N then it all fits in the preallocated space.

This is great for keeping memory on the stack when N is small, yet allow heap memory overflow for larger N.

Re:Rust 1.51 by withtypes on Thursday March 25, 2021 @03:02PM (#26584062)
In Rust there is smallvec https://docs.rs/crate/smallvec/