small_vector improvements
Summary: 1. `emplace_back()` is broken when there are at least two arguments and one is a reference to inside the vector. See the `ForwardingEmplaceInsideVector` test. 2. Only `push_back(value_type&&)` did exponential growth, every other function grew linearly. The bug is hidden inside of facebook because `goodMallocSize()` grows fast enough to not be horribly slow. When not using jemalloc, it will grow one element at a time. 3. `push_back(value_type const& t)` performed a copy and a move on `t` when `size() == capacity()`. Remove the extra move. Fixes https://github.com/facebook/folly/issues/541. Reviewed By: luciang Differential Revision: D4875084 fbshipit-source-id: eefa76028c6bfd9d7c73af65e8bb9d4baf49b8cb
Showing
Please register or sign in to comment