Boost logo

Boost Users :

Subject: Re: [Boost-users] Interprocess : vectors of vectors
From: Oodini (svdbg____at_[hidden])
Date: 2013-05-14 09:02:52


> 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 am studybing this point.
If you construct an empty vector in a managed shared memory, you have already 152 bytes consumed.
I'd like to be sure that this value is always same.

> 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!

It seem you can already do that :

http://www.boost.org/doc/libs/1_52_0/doc/html/interprocess/managed_memory_segments.html#interprocess.managed_memory_segments.managed_memory_segment_advanced_features.growing_managed_memory

But as I already know the number of bytes I have to deserialize, I'd like to avoid reallocation.


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