Re: [PATCH v5 0/3] rust: alloc: add KVVec shrinking method
From: Alice Ryhl
Date: Mon Feb 16 2026 - 03:45:35 EST
On Sun, Feb 15, 2026 at 02:05:20AM +0530, Shivam Kalra via B4 Relay wrote:
> This series adds a shrink_to() method to KVVec to allow explicit
> capacity reduction for memory reclamation.
>
> Problem:
> When elements are removed from a KVVec, the allocated capacity is not
> reduced. The underlying C allocators (krealloc/kvrealloc) don't shrink
> memory in-place. This can cause significant memory waste in scenarios
> with variable workloads.
Overall looks good to me!
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>