Learn C++ STL

Lesson 5 of 9 · Under the Hood: Memory, Cache, Allocators and the Guarantees

Module 17 · Under the Hood: Memory, Cache, Allocators and the Guarantees

Allocators, One Pool, and a Cheap Vector Return

ProReading

Alice repeatedly builds a temporary list for each report page. The nodes disappear before the next page starts. Kenji wants a custom memory system immediately. Amara first asks whether ordinary allocation is the measured bottleneck. This lesson names one alternative and keeps its scope small.

Checking what this lesson needs for you…

What is inside Allocators, One Pool, and a Cheap Vector Return

  1. Storage is not an object
  2. Why another allocation policy can exist
  3. One simple pool, one honest boundary
  4. Returning a vector can transfer ownership