Container library without heap usage

Discussion in 'C++' started by sh, May 4, 2010.

  1. sh

    sh Guest

    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!
     
    sh, May 4, 2010
    #1
    1. Advertisements

  2. 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?
     
    Vladimir Jovic, May 4, 2010
    #2
    1. Advertisements

  3. sh

    sh Guest

    On May 4, 2:01 pm, Vladimir Jovic <> 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.
     
    sh, May 4, 2010
    #3
  4. sh wrote:
    > On May 4, 2:01 pm, Vladimir Jovic <> 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.
     
    Vladimir Jovic, May 4, 2010
    #4
  5. sh

    gpderetta Guest

    On May 4, 12:50 pm, 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
    >
    > 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
     
    gpderetta, May 4, 2010
    #5
  6. sh

    sh Guest

    On May 4, 4:47 pm, gpderetta <> wrote:
    [...]
    > Take a look at boost.intrusive.
    >
    > --
    > Giovanni P. Deretta


    Thanks a lot, this was exactly the thing I needed.
     
    sh, May 4, 2010
    #6
  7. Chris M. Thomasson, May 4, 2010
    #7
  8. sh

    Jorgen Grahn Guest

    On Tue, 2010-05-04, sh wrote:
    > On May 4, 2:01 pm, Vladimir Jovic <> 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 .
     
    Jorgen Grahn, May 7, 2010
    #8
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anjo Gasa
    Replies:
    5
    Views:
    409
    Alf P. Steinbach
    Apr 26, 2006
  2. sandeep
    Replies:
    4
    Views:
    447
    Noah Roberts
    Jun 5, 2006
  3. Michal Slocinski

    Heap dump file size vs heap size

    Michal Slocinski, Mar 25, 2008, in forum: Java
    Replies:
    1
    Views:
    1,042
    GArlington
    Mar 25, 2008
  4. viki
    Replies:
    6
    Views:
    862
    Erik Wikström
    Jun 28, 2008
  5. jacob navia
    Replies:
    5
    Views:
    661
    jacob navia
    Sep 28, 2009
  6. jacob navia
    Replies:
    10
    Views:
    771
    jacob navia
    Oct 1, 2009
  7. Krist
    Replies:
    8
    Views:
    9,249
    Arne Vajhøj
    Feb 10, 2010
  8. Raymond Schanks
    Replies:
    0
    Views:
    795
    Raymond Schanks
    Apr 11, 2010
Loading...