3 ms·
>I do think it's silly for operators new/delete to have a separate free list from malloc()/free(). They don't. This is a custom, simple, non-default pool alloc
by gpderetta 10y ago
>I do think it's silly for operators new/delete to have a separate free list from malloc()/free().
They don't. This is a custom, simple, non-default pool allocator for standard containers (i.e nothing to do with new)
- maxlybbert 10y agoThanks for the correction. But it's just as silly to create an allocator for the standard containers, when the allocator consists of little more than free list management, given that malloc/free and new/delete already do that. It's especially silly for a library (programs may want custom memory management and libraries really shouldn't go out of their way to make that harder), and the fact that it's the standard library doesn't make it less silly.
- jwakely 10y agoGCC's std::allocator also doesn't do that (not for at least a decade, IIRC). It's a non-default allocator, which nobody is forced to use. It's entirely optional. The default std::allocator just uses new/delete.