|
Boost : |
Subject: Re: [boost] [boost.lockfree] spsc_queue preallocated memory block
From: Tim Blechmann (tim_at_[hidden])
Date: 2014-10-25 16:15:50
> I have a feature request for Boost.lockfree (spsc_queue in particular).
> When using the runtime sized version, could there possibly be a
> constructor that takes max_size as well as a T* that is then used as the
> memory buffer? This would remove the need for a specialized allocator if
> I want to quickly initialize the buffer with memory that does not come
> from the default std allocator.
this would only work for spsc_queue, as the other data structures will
have some memory-overhead ... but even for spsc_queue, i'm don't like
this too much, as
(a) the same can be achieved using the allocator
(b) it will mess up the implementation quite a bit
i might consider a patch, if it does not complicate the implementation
too much ... but in general i guess it is cleaner to provide an
allocator that wraps your pre-allocated memory.
tim
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk