News for hackers. Stuff that matters.
Re:Unsafe Rust Is Harder Than C by LegionMammal978 on Saturday October 26, 2024 @11:43AM (#41955452)
You do get some determinism, in that as long as the length of the vector is less than its capacity, it will never reallocate the buffer when new elements are added. And there are plenty of functions like Vec::with_capacity(), Vec::reserve(), Vec::reserve_exact(), etc. which let you control the capacity. The only unspecified part is by how much the capacity grows when the vector does have to reallocate.

There are no comments on this comment yet.