CppCon 2019 has ended
Back To Schedule
Thursday, September 19 • 16:45 - 17:45
test_resource: The pmr Detective

Log in to save this to your schedule, view media, leave feedback and see who's attending!

This session will provide an introduction to pmr::test_resource, which supports testing memory allocation related behavior on a per-object basis. pmr::test_resource is a C++17 memory resource designed for testing that can be plugged into any test framework. It is the modernized version of the bslma::TestAllocator used in production for over two decades at Bloomberg, where it has helped to expose a variety of bugs, such as memory leaks, overruns, multiple deletes, exception-safety guarantee failures etc.

This presentation will show the use of test_resource in detecting errors related to memory allocation. We walk through code to demonstrate several bugs and show how they misbehave, how we diagnose them, and a reasonable fix. pmr::test_resource is being proposed for the Library Fundamentals 3 TS and full source code for test_resource, bslma::TestAllocator and the examples is available on GitHub.

Thursday September 19, 2019 16:45 - 17:45 MDT
Summit 6/7
  • Software Evolution/Testing