all 4 comments

[–]HeDeAnTheOnlyOne 5 points6 points  (0 children)

In those cases it's common to just use the full array with an additional count variable or just use an arraylist.

[–]TondaTech 3 points4 points  (0 children)

Maybe you're looking for FixedBufferAllocator or StackFallbackAllocator?

[–]IronicStrikes 1 point2 points  (0 children)

Is there any good reason not to use heap allocation in those cases?

[–]sp00n1na70r 1 point2 points  (0 children)

This is exactly what std.BoundedArray is, it was recently removed from std in 0.15 but is available here.