Similarly, eventually I realized that a problem I was having was that my ArrayLists were being allocated on the stack. Okay, I can sort of see how that makes sense, even though you have to hand them an allocator. Not that the error messages helped.
Can you allocate an ArrayList on the heap via something like `new std.ArrayList(u32)(...)`? Of course not. As far as I can tell, the best you can do is
var ptr = try alloc.create(std.ArrayList(u32));
ptr.* = std.ArrayList(u32).init(alloc);
There are a few things in the language that are really nice so far, but a whole lot of things where the language just doesn't tell you you've done something wrong until a totally different part of your code explodes with a cryptic error message.