pub fn sort_with_vec<T: Ord>(v: &mut [T], scratch_buf: &mut Vec<T>)
Like sort, except this function allocates its scratch space with scratch_buf.reserve(_).
sort
scratch_buf.reserve(_)
This allows you to re-use the same allocation many times.