
17 Mar
2010
17 Mar
'10
8:27 p.m.
AMDG B Hart wrote:
Sorry, I don't get you...as I understand the pool is a singleton, and once out of scope I would assume all the memory for the set is released back to the OS. Therefore what is the purpose of release_memory()...maybe I don't understand pool. And then "internal node type"...what is that?
Set is implemented using a binary search tree. set<int> doesn't actually allocate ints, it allocates a struct that probably looks something like: struct Node { int value; int color; Node * left; Node * right; Nonde * parent; }; pool_allocator uses separate singleton pools for each size of element that it needs to handle. In Christ, Steven Watanabe