Boost logo

Boost Users :

Subject: [Boost-users] [interprocess] Determine size of managed_shared_memory
From: Kai Benndorf (kai.benndorf_at_[hidden])
Date: 2010-08-05 10:39:56

Hi all,

I want to create a managed_shared_memory in exactly the size I needed.
Therefore I do something like this:

size = sizeof( common_managed_shared_memory );
size += sizeof( MyClassInSharedMem );

managed_shared_memory segment(create_only, "name", size );

MyClassInSharedMem allocates itself some memory by segment->allocate().
I added this also to the size, but get a boost::interprocess::bad_alloc
exception on allocating this additional memory.

Are there some magic bytes I forgot to add?

Many thanks in advance


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at