“An allocator model for std2”
summary
Proposes replacing the many C++ allocator models with a single pmr-like runtime model that keeps allocators out of the type system, stashes a memory_resource pointer in allocator-aware objects, and passes a hidden allocator argument during construction (example: implicit allocator-awareness and inject from_stack). Claims real workloads see 3–5x throughput on allocation and larger runtime gains from locality; tradeoffs include virtual dispatch and void* APIs (no fancy pointers). Bloomberg-grade implementations exist and report large performance and instrumentation wins.
AI-written summary · about
chapters (28)
- 0:00Intro
- 0:52What is an allocator?
- 1:33Why Do We Want Allocators?
- 2:38Performance
- 8:59Utility
- 9:47Special Memory
- 11:20How are allocators made available in C++98?
- 15:13Weasel Words
- 16:43Allocator Traits
- 20:53How did we improve support in C++17
- 24:24How does pmr work?
- 26:40memory_resource
- 28:21Idiom and usage of pmr
- 34:12Limitations of pmr
- 35:30Bloomberg Experience
- 36:43Why Complexity Matters
- 39:31Allocator Propagation
- 42:13Why Propagation Matters
- 43:06Complexity of Propagation
- 43:28Syntactic overhead is high
- 45:55Copy Constructor Issue
- 48:20Allocator Awareness
- 50:18Implementing Awareness
- 52:10Implicit Awareness
- 52:25Allocator Injection
- 53:42Example Code
- 56:20Containers use allocators internally
- 56:57Allocator Customization
related talks
01h 01mGetting Allocators out of Our Way
01h 13mValue Proposition: Allocator-Aware (AA) Software
01h 26mFrictionless Allocators
49mMost Malleable Memory Management Method in C++
01h 03mMost Malleable Memory Management Method
01h 03mAn Allocator is a Handle to a Heap
01h 25mTaming Dynamic Memory - An Introduction to Custom Allocators
04mAn allocator is a handle to a heap
