This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __USE_MALLOC sanity check


>   // 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?

I did this. It's probably a hack. I did it because parts of the standard
tested by commerical regression suites test to make sure that
allocator::allocate calls new.

> 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.

I think that the allocator bits are kind of crufty, and in general the
documentation in source does not appear to be sufficient. Perhaps Matt
could clarify?

-benjamin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]