Dear All, As it was previously possible to use shmem shared memory allocator with STL containers, is it still possible to use the interprocess shared memory allocator along with STL containers? If I try to use a STL container with interprocess shared memory allocator, I get the following error: Error: cannot convert boost::interprocess::offset_ptr<type> to type* Can someone help with this issue? Regards, Sunil Chomal
On 1/17/07, Sunil Chomal
As it was previously possible to use shmem shared memory allocator with STL containers, is it still possible to use the interprocess shared memory allocator along with STL containers? If I try to use a STL container with interprocess shared memory allocator, I get the following error:
Error: cannot convert boost::interprocess::offset_ptr<type> to type*
That could well be an issue of the STL implementation not honouring the allocator's pointer_type (and just using value_type* instead), but I'm unsure.
Dear All,
Hi,
As it was previously possible to use */_shmem_/* shared memory allocator with STL containers, is it still possible to use the */_interprocess_/* shared memory allocator along with STL containers? If I try to use a STL container with interprocess shared memory allocator, I get the following error:
The general shmem shared memory allocator was never intended to be used with STL containers, because I don't know about any STL implementation that accepts allocators that define allocator::pointer types as non-raw pointers. The only possibility was using fixed address mapping. You can use "fixed_managed_shared_memory" instead of "managed_shared_memory" (it's in the reference but there is no example in the code) to achieve this. allocators created from the segment manager produced by "fixed_managed_shared_memory" create shared memory allocators compatible with STL implementations. Hope this helps. Regards, Ion
participants (3)
-
Ion Gaztañaga
-
me22
-
Sunil Chomal