This is an archive of the discontinued LLVM Phabricator instance.

Extract key to avoid preemptive mallocs in insert/emplace in associative containers
ClosedPublic

Authored by EricWF on Mar 30 2016, 9:15 PM.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 52170.Mar 30 2016, 9:15 PM
EricWF retitled this revision from to Extract key to avoid preemptive mallocs in insert/emplace in associative containers.
EricWF updated this object.
EricWF added reviewers: mclow.lists, dexonsmith.
EricWF added a subscriber: cfe-commits.
dexonsmith edited edge metadata.Apr 1 2016, 2:39 PM
dexonsmith added a subscriber: dexonsmith.

LGTM. Thanks for picking this up (and sorry for getting distracted)!

mclow.lists accepted this revision.Apr 13 2016, 8:53 AM
mclow.lists edited edge metadata.

This looks good to me, except for the noisy tests.

test/std/containers/associative/set/insert_and_emplace_allocator_requirements.pass.cpp
30

In general, we want tests to be silent on success.

This revision is now accepted and ready to land.Apr 13 2016, 8:53 AM
EricWF added inline comments.Apr 13 2016, 9:50 AM
test/std/containers/associative/set/insert_and_emplace_allocator_requirements.pass.cpp
30

I'll see what I can do. The reason these tests are so noisy is because almost all of the assertions are in "container_test_types.h". Meaning that when the tests fail the diagnostic points into the header with no information about what code actually triggered the assertion. Hence why these tests manually print what they are testing.

I'll try and come up with something better.

EricWF updated this revision to Diff 53968.Apr 15 2016, 4:30 PM
EricWF edited edge metadata.

I've silenced the tests when they pass as suggested. I added a 'assert_checkpoint.h' support header that stores the last checkpoint a test has passed and prints that information when std::abort is called.

I also moved the allocator requirement test templates into generic headers so the same version can be used by both the associative and unordered containers. Previously each test was duplicated.

EricWF closed this revision.Apr 15 2016, 4:32 PM
test/std/containers/associative/multiset/insert_allocator_requirements.pass.cpp