Getting Allocators out of Our Way
summary
Shows how C++ polymorphic allocators (pmr) plus a compiler-supported “allocator-aware” class model eliminate most boilerplate: a stack-buffer + monotonic_buffer_resource yields a 5x speedup on a string-unique-count example; rewriting a heavyweight type drops constructors from about 15 to 5; a prototype compiler and experiments with GCC/Clang explore injecting implicit allocator propagation for aggregates, move/copy, and scoped allocation chains (unsynchronized pool, monotonic, test resource) and the design appears to work without runtime overhead.
AI-written summary · about
chapters (41)
- 0:00Introduction
- 0:20Getting Allocators out of Our Way
- 2:15Costs
- 3:06Language Proposal
- 3:22Michelangelo
- 3:39Pablo Halpern
- 6:35Outline
- 7:09Memory Performance
- 8:09Why Custom Memory Allocation
- 9:49Fragmentation
- 10:14Alligators
- 12:36Nesting Containers
- 13:52Scoped Allocator Model
- 15:13Instantiating Allocators
- 17:50Congratulations
- 18:02Polymorphic Memory Resource
- 21:43Polymorphic Alligator Bite
- 22:56Memory Allocation
- 23:48Unsynchronized Pool
- 25:57Monotonic Buffer Resource
- 27:43Test Resource
- 28:42Chained Resources
- 29:34Allocators
- 29:49Constructor
- 30:01Alligator
- 31:41Complications
- 33:53HashMap
- 34:44Constructors
- 35:50Recap
- 37:02Language solution
- 37:31Pablos solution
- 38:45Pablos ideal solution
- 39:17Alligator aware type
- 40:48Essential properties
- 42:20The real when
- 45:06Result
- 46:07Example
- 49:31Aggregates
- 52:53Backwards compatibility
- 55:10Summary
- 57:14Questions
related talks
01h 01mAllocators: The Good Parts
01h 25mTaming Dynamic Memory - An Introduction to Custom Allocators
49mMost Malleable Memory Management Method in C++
01h 26mFrictionless Allocators
06mLightning Talk: Speeding up code with C++17 Polymorphic Memory Resources
57m“An allocator model for std2”
01h 04mHow to Write a Custom Allocator
01h 01mRecipes for Reducing Allocations by C++ Containers
