3 ms·
Thanks for the correction on localtime, but they point is not avoiding allocation completely, is being explicit about it. All functions in Zig's stdlib that all
by kristoff_it 6y ago
Thanks for the correction on localtime, but they point is not avoiding allocation completely, is being explicit about it. All functions in Zig's stdlib that allocate memory take an allocator as parameter.
That's pretty much the whole point: allowing the programmer to know if a function might allocate or not, and allow them to customize which allocation scheme to use by passing in whatever allocator they prefer.