Boost logo

Boost :

From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-03-19 20:04:39


On Wed, Mar 19, 2008 at 4:20 PM, Mathias Gaunard wrote:
> Sergei Politov wrote:
> > As far as I understand it is possible to use in boost::any techniques similar to
> > boost::function. I.e. split virtual behavior and actual data. It will help to
> > avoid heap allocation while copying boost::any with stored small objects.
> >
> > What do you think about adding it to next releases of boost?
>
> Personally, I wonder if it wouldn't be more interesting to create an
> unified allocator system that allows Small Buffer Optimization, rather
> than rewriting the wheel for every component that may need it.

>From a certain point of view, the small object optimizations used by
boost::function is separate from optimizing memory allocations, as it
avoids the need to allocate memory. In addition, it improves cache
coherency.

I agree that boost::any can benefit not only from small object
optimizations but also from the new allocator semantics of
std::function, as defined in
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2308.html
(which are identical to the allocator support in shared_ptr.)

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk