Stream: git-wasmtime

Topic: wasmtime / PR #2505 Fix a memory reservation bug in `rese...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 14 2020 at 16:00):

alexcrichton opened PR #2505 from fix-reserve-bug to main:

This method attempted to reserve space in the results list of final
modules. Unfortunately results.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 to reserve as it represents the number of modules that will
eventually make their way into the result vector.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 14 2020 at 18:12):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 14 2020 at 18:12):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 14 2020 at 18:12):

fitzgen created PR Review Comment:

lol this field name cracks me up

view this post on Zulip Wasmtime GitHub notifications bot (Dec 14 2020 at 18:12):

fitzgen merged PR #2505.


Last updated: Oct 23 2024 at 20:03 UTC