I wanted to have a lot of temporary allocations and deallocations on a stack, with variable sizes, but whose total size I can predict at the beginning of the computation. I could just allocate from the heap each time, but that creates unnecessary overhead for such a simple pattern where I can just get the memory from the heap once and then allocate and deallocate on a stack in constant time.
Is there a crate for this? I have seen bumpalo, but it doesn't quite match the requirement because it doesn't guarantee deallocated memory can be reused.
I wrote a little module that does this, ensuring at compile time that allocations and deallocations are done in a stack-like way, and am wondering whether it makes sense to publish.