GeneralPurposeAllocator for Debug Safety
Catch leaks and double-frees.
Your Default Choice
When you are not sure which allocator to use, reach for the GeneralPurposeAllocator. It is safe, flexible, and great while you develop. 🛡️
Create One
The GeneralPurposeAllocator is a generic type you instantiate. You create an instance and then ask it for the actual allocator interface.
var gpa = std.heap.GeneralPurposeAllocator(.{}){};All lessons in this course
- GeneralPurposeAllocator for Debug Safety
- Arena Allocators for Bulk Free
- FixedBufferAllocator with No Heap
- Choosing an Allocator per Workload