Skip to main content

with_seq_reserve

Function with_seq_reserve 

Source
pub fn with_seq_reserve<T>(n: i64, f: impl FnOnce() -> T) -> T
Expand description

Run f with the per-collection reserve set to n (restored after). Use a small n for a program that fills its collections sequentially (e.g. the whole-transformer fabric engine) to right-size its heap.