patch: mt_allocator.h

Dhruv Matani dhruvbird@gmx.net
Wed Jun 9 03:03:00 GMT 2004


On Tue, 2004-06-08 at 20:21, Paolo Carlini wrote:
> Dhruv Matani wrote:
> 
> >> Before any other consideration: is this regtested?
> >
> > It originally wasn't, but after running it, the patch did pass the
> > tests, so it's ok ;-)
> 
> Ok, thanks. Check-performance too?

Check-performance.

> 
> I agree with you that, at least, this is the original SGI/HP design
> for pool_allocator: see the attached patch, which I will commit soon
> to mainline (if nobody object, indeed).
> 
> About mt_allocator, I'd like to think about it a little bit more: I'm
> not 1000% sure that this is always the best choice also in presence of
> threads, and so on.

Think about it this way. Suppose it wasn't, and I used:
list<int>;
list<string>;
list<float>;

Then, under the current design, all would have their separate free-lists
per thread! Which is obviously insane!



> 
> In any case, what about not splitting mt_allocator in a __gnu_internal::
> part and a std:: part? 

You mean a __gnu_internal and a __gnu_cxx part right?

> Can't we put *all* the implementation details
> inside _Mt_alloc_base?

Probably? Would you want me to try and do that?

-- 
        -Dhruv Matani.
http://www.geocities.com/dhruvbird/

Proud to be a Vegetarian.
http://www.vegetarianstarterkit.com/
http://www.vegkids.com/vegkids/index.html




More information about the Libstdc++ mailing list