Scott Meyers
2003-11-06 16:44:52 UTC
For the node-based containers, one thing has always nagged at the back of
my mind. To increase the performance of node allocation, one can keep a
free list of nodes that have been freed. But who keeps this free list, the
container or the allocator? The allocator seems like the logical place to
do it, but I can also imagine a container doing it. I've never bothered to
check STL implementations to see if any containers keep their own node free
lists, but I'm thinking that somebody reading this probably has. Is there
any reason why a container *can't* keep its own free list of nodes? Does
anybody know of any container implementation that actually does?
All enlightenment appreciated,
Scott
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
my mind. To increase the performance of node allocation, one can keep a
free list of nodes that have been freed. But who keeps this free list, the
container or the allocator? The allocator seems like the logical place to
do it, but I can also imagine a container doing it. I've never bothered to
check STL implementations to see if any containers keep their own node free
lists, but I'm thinking that somebody reading this probably has. Is there
any reason why a container *can't* keep its own free list of nodes? Does
anybody know of any container implementation that actually does?
All enlightenment appreciated,
Scott
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]