3 ms·
It's not the 'default' it's the behaviour of this allocator. This makes this allocator fast, but it should clearly be named/described I agree.
by renox 4y ago
It's not the 'default' it's the behaviour of this allocator.
This makes this allocator fast, but it should clearly be named/described I agree.
- jpcfl 4y agoThanks. Yeah, that's my point. The naming doesn't make it obvious. Personally, I would have called this a StackAllocator, that way the alloc/free order requirement is obvious. I would have made the default behavior to 'panic()' if you don't satisfy the precondition of freeing the most recently allocated buffer. If somebody really wanted to make free a no-op, I'd offer a feature flag to turn that on.