Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Container library without heap usage (http://www.velocityreviews.com/forums/t722147-container-library-without-heap-usage.html)

sh 05-04-2010 11:50 AM

Container library without heap usage
 
Hi,

knows someone a library for container classes like lists, maps, etc.
which is implemented without heap usage (no dynamic memory usage at
all). Example

class A {
Node node; // Required by List<T>
// Other class A stuff
};

List<A> list;
A a;

list.push(a);

Have a nice day!

Vladimir Jovic 05-04-2010 12:01 PM

Re: Container library without heap usage
 
sh wrote:
> Hi,
>
> knows someone a library for container classes like lists, maps, etc.
> which is implemented without heap usage (no dynamic memory usage at
> all). Example


What would it use instead?

sh 05-04-2010 12:12 PM

Re: Container library without heap usage
 
On May 4, 2:01*pm, Vladimir Jovic <vladasp...@gmail.com> wrote:
> sh wrote:
> > Hi,

>
> > knows someone a library for container classes like lists, maps, etc.
> > which is implemented without heap usage (no dynamic memory usage at
> > all). Example

>
> What would it use instead?


The classes likely have to provide some stuff required by the
particular container. The example indicates this with the Node member
of class A. In C you have something similar available via <sys/
queue.h> in FreeBSD for example.

Vladimir Jovic 05-04-2010 12:31 PM

Re: Container library without heap usage
 
sh wrote:
> On May 4, 2:01 pm, Vladimir Jovic <vladasp...@gmail.com> wrote:
>> sh wrote:
>>> Hi,
>>> knows someone a library for container classes like lists, maps, etc.
>>> which is implemented without heap usage (no dynamic memory usage at
>>> all). Example

>> What would it use instead?

>
> The classes likely have to provide some stuff required by the
> particular container. The example indicates this with the Node member
> of class A. In C you have something similar available via <sys/
> queue.h> in FreeBSD for example.



You can take a look at stl port - it might have that option.

gpderetta 05-04-2010 02:47 PM

Re: Container library without heap usage
 
On May 4, 12:50*pm, sh <seb...@gmail.com> wrote:
> Hi,
>
> knows someone a library for container classes like lists, maps, etc.
> which is implemented without heap usage (no dynamic memory usage at
> all). Example
>
> class A {
> * Node node; // Required by List<T>
> * // Other class A stuff
>
> };
>
> List<A> list;
> A a;
>
> list.push(a);
>


Take a look at boost.intrusive.

--
Giovanni P. Deretta

sh 05-04-2010 03:12 PM

Re: Container library without heap usage
 
On May 4, 4:47*pm, gpderetta <gpdere...@gmail.com> wrote:
[...]
> Take a look at boost.intrusive.
>
> --
> Giovanni P. Deretta


Thanks a lot, this was exactly the thing I needed.

Chris M. Thomasson 05-04-2010 04:48 PM

Re: Container library without heap usage
 
"sh" <sebhub@gmail.com> wrote in message
news:2ec134d2-0a0c-4554-b797-31a41261ba22@o8g2000yqo.googlegroups.com...
On May 4, 4:47 pm, gpderetta <gpdere...@gmail.com> wrote:
[...]
> > Take a look at boost.intrusive.


> Thanks a lot, this was exactly the thing I needed.


You might be interested in this as well:

http://groups.google.com/group/comp....d5f353c493e56a


Jorgen Grahn 05-07-2010 03:30 PM

Re: Container library without heap usage
 
On Tue, 2010-05-04, sh wrote:
> On May 4, 2:01*pm, Vladimir Jovic <vladasp...@gmail.com> wrote:
>> sh wrote:
>> > Hi,

>>
>> > knows someone a library for container classes like lists, maps, etc.
>> > which is implemented without heap usage (no dynamic memory usage at
>> > all). Example

>>
>> What would it use instead?

>
> The classes likely have to provide some stuff required by the
> particular container. The example indicates this with the Node member
> of class A. In C you have something similar available via <sys/
> queue.h> in FreeBSD for example.


OK, but then it's not not a container class -- it doesn't really own
the things it "contains", nor manage their lifetimes.

Might be useful, but it's not a container.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .


All times are GMT. The time now is 11:42 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57