Two advanced PMR techniques in C++17/20
summary
Covers polymorphic memory resources (monotonic_buffer_resource, pool_resource) and concrete tradeoffs, then demonstrates two techniques Winking Out and Localized Garbage Collection, with working code variants: C++20’s convenience new_object versus C++17’s two‑step allocate+construct, and a Bloomberg allocator comparison. Shows that reclaiming whole arenas avoids destructor recursion and stack overflow but invites UB if destructors have side effects, and explains why shared_ptr and allocator‑aware types don’t always mix — useful but expert‑only.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 11:12Allocators
- 17:20Questions
- 21:51Wingout
- 25:07Example code
- 27:21Problems
- 31:03Uneven behavior
- 32:56JSON data representation
- 34:50Protocol buffers
- 42:36Can we use smart pointers
- 44:04Polymorphic memory resources
- 45:48Distractors
- 46:41Chat pointer
- 47:11Summary
- 48:16Outro
related talks
01h 03mTaming dynamic memory
06mUsing PMR in C++ Embedded Systems for Functional Safety
58mLeveraging C++20/23 Features for Low Level Interactions
50mDesigning and Implementing a new Allocator model
01h 03mUnlocking the value of C++20
01h 01mEmbracing PODs Safely Until They Die
57mDynamic memory allocation challenges in safety critical systems
56mC++ Relocation - How to Achieve Blazing Fast Save and Restore and More!
