Designing and Implementing a new Allocator model
summary
Argues for a concrete replacement of the STL allocator: a single raw allocator model that allocates bytes not types, adds alignment and separate node/array APIs, and stores movable references so containers can share stateful allocators. Implements stack, pool, static and virtual block allocators, a composable try_allocate/try_deallocate scheme for fallback composition, STL adapter glue, and a joint allocation facility that packs object and member buffers into one block. Ships working code and microbenchmarks versus Boost pool showing competitive performance.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:06STL allocator problems
- 4:14New raw allocator design
- 9:09Simpler raw allocator interface
- 12:45Implementing new allocator
- 13:26Stack allocator
- 16:59Block allocator
- 21:39Pool allocator
- 24:27Adapting allocators
- 25:54Composing allocators
- 28:44Block allocator examples
- 32:40Practical allocator boilerplate
- 35:48Joint memory allocations
- 41:31Q&A
related talks
01h 03mTaming dynamic memory
50mTwo advanced PMR techniques in C++17/20
56mC++ Relocation - How to Achieve Blazing Fast Save and Restore and More!
01h 00mSTL Features And Implementation Techniques
01h 01mBreaking Dependencies - C++ Type Erasure - The Implementation Details
01h 03mWriting sustainable software. The how and the what!
57mDynamic memory allocation challenges in safety critical systems
37mTrack your memory allocation
