Boost logo

Boost :

Subject: Re: [boost] stack-allocated STL-containers
From: Christian Schladetsch (christian.schladetsch_at_[hidden])
Date: 2009-08-13 18:00:37

There was an overlong discussion about this some time ago.

You could look at boost::auto_buffer. I also have a system that does this
using a generalised allocator in the sandbox

Two immediate issues are alignment and the fact that you are using a
stateful allocator. However, in the case you provide it would work. It's
just not a very interesting case.


On Fri, Aug 14, 2009 at 6:21 AM, Mateusz Loskot <mateusz_at_[hidden]> wrote:

> Stefan Strasser wrote:
> > I recently ran into the problem that a local container on the stack,
> which was
> > likely to be very small, but its size was still not known at
> compile-time,
> > consumed a considerable amount of runtime because of
> allocation/deallocation.
> > [...]
> I'd try to find out if the std::vector of that implementation
> doesn't provide short array optimisation.
> Peraps STLport does, I'm not sure.
> That would solve this issue.
> Best regards,
> --
> Mateusz Loskot,
> Charter Member of OSGeo,
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at