Caveat emptor, I don't write Zig but followed its development closely for awhile. A core design element of zig is that you shouldn't be stuck with one particular memory model. Zig encourages passing an allocator context around, where those allocators conform to a standardized interface. That means you could pass in different allocators with different performance characteristics at runtime.
But yes, there is a default allocator, std.heap.page_allocator
> Zig encourages passing an allocator context around, where those allocators conform to a standardized interface.
in libraries. if youre just writing a final product it's totally fine to pick one and use it everywhere.
> std.heap.page_allocator
strongly disrecommend using this allocator as "default", it will take a trip to kernelland on each allocation.
std.heap.smp_allocator
You should basically only use the page allocator if you're writing another allocator.
> you shouldn't be stuck with one particular memory model
Nit: an allocator is not a "memory model", and I very much want the memory model to not change under my feet.