Feedback on __mt_alloc?

Nathan Myers ncm-nospam@cantrip.org
Thu Apr 24 20:38:00 GMT 2003


On Thu, Apr 24, 2003 at 04:19:36PM -0400, Phil Edwards wrote:
> On Thu, Apr 24, 2003 at 08:19:42PM +0200, Stefan Olsson wrote:
> > Benjamin Kosnik wrote:
> > 
> > >>Looking at the current stl_alloc.h that would only be __malloc_alloc
> > >>and __debug_alloc right?
> > >
> > >I was thinking of moving them all over, so __pool_alloc would also
> > >be fair game.
> > >
> > Hmmm...
> > ...so stl_alloc.h would only contain __new_alloc as required by the 
> > standard? That would be really nice and clean!
> 
> Let's be more clear about this:  the standard doesn't require "stl_alloc.h"
> nor "__new_alloc".  It just requires that the default container allocator
> use new/delete.

Not even that.  It requires the library to behave "as if" it uses
new/delete.  What that means in practice is that if the user supplies
an alternative new and/or delete, the library has to use them.  If not, 
then the library can do any damn thing that works.

Nathan Myers
ncm-nospam@cantrip.org



More information about the Libstdc++ mailing list