[Bug libstdc++/92300] Useless allocator call in std::map, when insert does not perform any insertion.

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 3 22:50:17 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92300

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Created attachment 51924
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51924&action=edit
Patch to avoid creating a node if inserting something key-like into a map

This avoids the allocate/deallocate pair for the failed insertion in your
original example.


More information about the Gcc-bugs mailing list