4 ms·
Perhaps that allocator could print a warning message if you're not deleting the last element (when built in debug mode). That would make it a lot more clear ho
by Dwedit 4y ago
Perhaps that allocator could print a warning message if you're not deleting the last element (when built in debug mode). That would make it a lot more clear how that kind of allocator should be used.
- jesse__ 4y agoI use this pattern a lot and my allocators print a huge warning when they detect this kind of leak. +1 for this suggestion. It's a hard bug to track down in nontrivial code.
- kprotty 4y agoFixedBufferAllocator is meant to minimally viable like in settings when there's no shared concept of "printing" or an OS for that matter. Check out LoggingAllocator which can take/wrap the former.
- deleted 4y ago[deleted]
- Dwedit 4y agoMaybe put the word "Sequential" in the name (like FixedBufferSequentialAllocator) to really hammer it down that you can't randomly delete. Then also have a movable head pointer so you can still deallocate in either reverse or forward order, it will still successfully free everything.