Topic: article: allocators...exceptions...new/delete [reply to: Sat, 12Jul 2003 09:24:52 -0400, James Kuyper].


Author: bop2@telia.com ("Bo Persson")
Date: Wed, 16 Jul 2003 21:28:58 +0000 (UTC)
Raw View
"Dhruv Matani" <dhruvbird@gmx.net> skrev i meddelandet
news:1058348000.3149.21.camel@home.free...
> On Sat, 12 Jul 2003 09:24:52 -0400, James Kuyper wrote:
>
> >> Yes, in fact, I have the 1996 draft copy.
> >
> > Get the real standard. There are LOTS of difference between that
draft
> > and the final version.
> >
>
> I will ASA I find someone to sponsor it :-) I wonder if the guys at
the
> ansi standard organization give any sort of student discount?

No, but they do sell the pdf version for $18.



Bo Persson
bop2@telia.com

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: richard@ex-parrot.com ("Richard Smith")
Date: Fri, 18 Jul 2003 02:37:02 +0000 (UTC)
Raw View
"Dhruv Matani" <dhruvbird@gmx.net> wrote in message
news:1058348000.3149.21.camel@home.free...
> On Sat, 12 Jul 2003 09:24:52 -0400, James Kuyper wrote:
>
> >> What is the advantage of using such stateful allocators?
> >
> > On simple kind of stateful allocator uses a new, distinct memory pool
> > each time a new instance of the allocator is created, and shares that
> > pool with every instance created by copy construction, copy
> > assignment, and conversion. Instances that use different memory pools
> > are inequivalent, because they don't have access to each other's
> > memory pools.
> >
>
> So, basically, it's like per-class allocators.

Not necessarily.  Another use is to have a separate pools for different
expected object lifetimes.  For example, I might use one allocator for
objects that I expect to only exist transiently and a second for longer
lived objects.  This sort of technique can help reduce memory
fragementation.

--
Richard Smith



---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]