[PATCH] D16360: unordered_map: Avoid unnecessary mallocs when no insert occurs

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 24 21:46:12 PST 2016


EricWF added a comment.

In http://reviews.llvm.org/D16360#334781, @dexonsmith wrote:

> Great, I should have time to clean this up tomorrow afternoon.
>
> Regarding emplace, this patch as is has tests for emplace, but
>  they depend on r258575 being in tree.  You asked me to revert
>  that... I'll wait for your response over in that thread:
>  http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160118/147795.html


Lets talk about that here to keep it together.

I agree with your approach where `insert(_Pp&&)` dispatchs to `emplace()`.  The single argument emplace call should then call `__insert_extract_key_if_pair`.


http://reviews.llvm.org/D16360





More information about the cfe-commits mailing list