1 comment

[ 3.3 ms ] story [ 17.5 ms ] thread
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