__USE_MALLOC sanity check
Phil Edwards
phil@jaj.com
Wed Jun 26 09:35:00 GMT 2002
Concerning this comment in stl_alloc.h:
// Determines the underlying allocator choice for the node allocator.
#ifdef __USE_MALLOC
typedef __malloc_alloc_template<0> __mem_interface;
#else
typedef __new_alloc __mem_interface;
#endif
Is "node allocator" meant to refer to std::allocator, or to the memory pool
__default_alloc_template?
Because the comments (largely inherited from SGI) elsewhere all use "node
allocator" to refer to the pool. But if __USE_MALLOC is in effect, then
the pool is completely bypassed.
Which raises another question: currently, we either use the pool + operator
new, or we use malloc. There is never a combination of malloc + pool.
Maybe that's the way it should be (it certainly strikes me as harmless),
but I wanted to make certain that this is known and intended.
Phil
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams
More information about the Libstdc++
mailing list