by SomeCallMeTim · 11y ago · 0 comments
In C++ you can also replace the allocator to pull items from a pool, so that the "allocation" is "grab the first item from the pool linked list" and "deallocation" is "link this item back into the pool." The first case costs two pointer reads and one write, the second case costs two pointer writes and one read.
This lets you use objects as if they're dynamically allocated while still keeping very costs in allocation/deallocation.
No comments yet.