On Tue, May 14, 2013 at 9:02 AM, Oodini
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.
It seem you can already do that :
http://www.boost.org/doc/libs/1_52_0/doc/html/interprocess/managed_memory_se...
But as I already know the number of bytes I have to deserialize, I'd like to avoid reallocation.
? Isn't that the point of your original question: you do not, in fact, know in advance the number of bytes you will need? If you have a way to move forward without getting stuck on this issue, finish your code, evaluate its performance and then -- if necessary -- run a profiler to figure out what actually needs improving. http://en.wikipedia.org/wiki/Program_optimization#Quotes