3 ms·
Most applications need more than one vector. Management of this with custom allocators pays dividends fairly quickly.
by krona 7y ago
Most applications need more than one vector. Management of this with custom allocators pays dividends fairly quickly.
- gpderetta 7y agoSorry, there is some confusion here. The OP is literally implementing a custom allocator. I'm saying that using std::vector for the backing store of your allocator is wrong because resizing will invalidate your already allocated objects (which is a no-can-do in a general purpose allocator) and the copying is wasteful. A custom fixed size chunk based allocator woud be better.