Boost logo

Boost :

Subject: Re: [boost] Proposal: Monotonic Containers
From: Jonas Persson (l.j.persson_at_[hidden])
Date: 2009-06-09 04:52:40


Hi,
can you motivate why the proposal are adding a new set of containers
instead of only an allocator to be used with the standard containers?

   / Jonas

Christian Schladetsch wrote:
> Hello,
>
> There is a need in high-performance realtime software to use containers that
> may only grow in size. These are typically reset at the end of each update
> cycle.
>
> The proposal here consists of a base 'monotonic allocator', which takes its
> storage from a buffer that you provide. Allocations are made from this
> buffer, and deallocation only calls an object's destructor; no actual
> memory-management is performed at all.
>
> This is very useful for realtime systems that have to do things like, for
> example, physics or renderering systems. These systems build up lists and
> other containers over the period of an update frame, however at the end of
> that frame the storage can just be reset.
>
> The benefit of using this system over a normal std::allocator is that memory
> is not fragmented, and memory allocation and deallocation is basically
> optimal.
>
> Within the package are:
>
> boost.monotonic.inline_storage
> boost.monotonic.list
> boost.monotonic.vector
> boost.monotonic.map
> boost.monotonic.set
> boost.monotonic.ptr_list
>
> I didn't bother adding the other ptr_* containers yet.
>
> The files for the proposal are in the vault at
> http://www.boostpro.com/vault/index.php?action=downloadfile&filename=MonotonicAllocator.zip&directory=&
> .
>
> I'd be happy to address any issues or comments. There are some improvements
> that could be made.
>
> Regards,
> Christian.
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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