alexcrichton opened PR #2505 from fix-reserve-bug to main:
This method attempted to reserve space in the
resultslist of final
modules. Unfortunatelyresults.reserve(nmodules)isn't enough here
because this can be called many times before a module is actually
finished and pushed onto the vector. The attempted logic to work around
this was buggy, however, and would simply trigger geometric growth on
every single reservation because it erroneously assumed that a
reservation would be exactly met.This is fixed by avoiding looking at the vector's capacity and instead
keeping track of modules-to-be in a side field. This is the incremented
and passed toreserveas it represents the number of modules that will
eventually make their way into the result vector.
fitzgen submitted PR Review.
fitzgen submitted PR Review.
fitzgen created PR Review Comment:
lol this field name cracks me up
fitzgen merged PR #2505.
Last updated: Dec 06 2025 at 06:05 UTC