4 ms·
Nice notes, I’ve also been using Zig for AoC. Instead of that queue, I prefer to use std.fifo.LinearFifo, which instead of being backed by a linked list, is bac
by skribanto 4y ago
Nice notes, I’ve also been using Zig for AoC. Instead of that queue, I prefer to use std.fifo.LinearFifo, which instead of being backed by a linked list, is backed by a simple ring buffer.
This buffer can either be statically allocated, dynamically allocated, or passed in if you have a preexisting buffer.
It is very similar to what you have already implemented on your own, just bundled into its own struct