Boost logo

Boost Users :

Subject: Re: [Boost-users] Interprocess : vectors of vectors
From: Nat Linden (nat_at_[hidden])
Date: 2013-05-14 08:41:52


On Tue, May 14, 2013 at 3:54 AM, Oodini <svdbg____at_[hidden]> wrote:

> They are not originally vectors of vectors.
> The data come from a database, and are serialized in Python. So no C++ and
> Boost.Inteprocess.

Graphical user interface toolkits typically have methods that ask,
"How much screen space do you require?" Container panels implement
this by recursively querying their contents and then adding their own
overhead.

But I've never heard of a C++ container library that predictively does
the same for memory consumption: "Given such-and-such content, how
many bytes of memory *would* you require?" I can see that for certain
use cases, that could be very handy, especially in embedded or
realtime systems.

I suspect, though, that the eventual solution to this particular
problem will be a higher-level interface to shared memory that can
grow or shrink the resource as needed. For right now, I can only
suggest that you overallocate and hope for the best. I will be
delighted to hear better suggestions from others!


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net