Choosing an Allocator per Workload
Match strategy to lifetime and speed.
One Interface, Many Strategies
Every allocator exposes the same std.mem.Allocator interface, so you can swap strategies without rewriting the code that uses memory. 🔁
Match Lifetime First
The key question is lifetime: how long must this memory live? The answer often points you straight at the right allocator.
All lessons in this course
- GeneralPurposeAllocator for Debug Safety
- Arena Allocators for Bulk Free
- FixedBufferAllocator with No Heap
- Choosing an Allocator per Workload