| Section | Title |
|---|---|
| 1 | Why Allocation Is Explicit |
| 2 | The Allocator Interface |
| 3 | Page Allocator |
| 4 | General-Purpose Allocator |
| 5 | Arena Allocator |
| 6 | Fixed-Buffer Allocator |
| 7 | Ownership Rules |
| 8 | Exercises |
Why Allocation Is ExplicitA program uses memory to store values.
The Allocator InterfaceAn allocator is a value that knows how to allocate and free memory.
Page AllocatorThe page allocator gets memory from the operating system.
General-Purpose AllocatorThe general-purpose allocator is used for ordinary heap allocation.
Arena AllocatorAn arena allocator is used when many allocations have the same lifetime.
Fixed-Buffer AllocatorA fixed-buffer allocator uses memory that already exists.
Ownership RulesAllocation creates a responsibility.
ExercisesThe exercises in this section are meant to make allocation habits precise. Each one should be written as a complete program unless stated otherwise.