Chris Jefferson | 21 May 17:25

Containers for already allocated memory

I am surprised that Boost does not seem to contain a vector-like
container which uses a pre-allocated block of memory. In my own code I
find this very useful, in particular with memory allocated by
'alloca'.

Have I missed such a package? Is there any interest in such a package
being submitted to boost if I tidied up my own code?

Chris
Igor R. | 21 May 18:16
Picon
Favicon

Re: Containers for already allocated memory

Look at Array and Intrusive libraries.


> I am surprised that Boost does not seem to contain a vector-like
> container which uses a pre-allocated block of memory. In my own code I
> find this very useful, in particular with memory allocated by
> 'alloca'.
>
> Have I missed such a package? Is there any interest in such a package
> being submitted to boost if I tidied up my own code?
>
> Chris
> _______________________________________________
> Boost-users mailing list
> Boost-users <at> lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Get news, entertainment and everything you care about at Live.com. Check it out!
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Chris Jefferson | 21 May 18:38

Re: Containers for already allocated memory

2008/5/21 Igor R. <igor_rubinov <at> hotmail.com>:
> Look at Array and Intrusive libraries.

Thanks, but neither of these really satisfy my requirements:

Intrusive is for things like lists, rather than a vector-type
structure, and as it is intrusive, I can't easily put pointers and
ints in it.

Arrays do go on the stack, but have to have a compile-type size and
you can't "push_back" into them.

Chris

>
>
>> I am surprised that Boost does not seem to contain a vector-like
>> container which uses a pre-allocated block of memory. In my own code I
>> find this very useful, in particular with memory allocated by
>> 'alloca'.
>>
>> Have I missed such a package? Is there any interest in such a package
>> being submitted to boost if I tidied up my own code?
>>
>> Chris
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users <at> lists.boost.org
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
> ________________________________
> Get news, entertainment and everything you care about at Live.com. Check it
> out!
> _______________________________________________
> Boost-users mailing list
> Boost-users <at> lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Bryan Green | 21 May 21:04
Picon
Favicon

Re: Containers for already allocated memory

"Chris Jefferson" writes:
> 2008/5/21 Igor R. <igor_rubinov <at> hotmail.com>:
> > Look at Array and Intrusive libraries.
> 
> Thanks, but neither of these really satisfy my requirements:
> 
> Intrusive is for things like lists, rather than a vector-type
> structure, and as it is intrusive, I can't easily put pointers and
> ints in it.
> 
> Arrays do go on the stack, but have to have a compile-type size and
> you can't "push_back" into them.

There's the interprocess library in 1.35.
Take a look at its "stl-compatible" containers, and the managed_external_buffer.

-bryan

Gmane