Subject: Re: [boost] Using boost::circular_buffer in boost::interprocess:managed_shared_memory
From: Jan Gaspar (jano_gaspar_at_[hidden])
Date: 2010-01-13 05:45:22
Actually I never tried using circular_buffer in conjuction with Interprocess library. But I think it should work. IMO the buffer obeys the Intrprocess container rules:
* Boost.Interprocess STL containers don't assume that memory allocated with an allocator can be deallocated with other allocator of the same type. They always compare allocators with operator==() to know if this is possible.
* The pointers of the internal structures of the Boost.Interprocess containers are of the same type the pointer type defined by the allocator of the container. This allows placing containers in managed memory segments mapped in different base addresses.
Passing an interprocess allocator to the circular_buffer will make elements (stored in the circular_buffer) to be allocated in the shared memory - but not the circular_buffer itself. You need to create the circular_buffer in the shared memory as well. Have a look at the vector example to find out how to do it:
Let me know if it worked.
----- Original Message ----
From: Taewan Kim <akatkim_at_[hidden]>
Sent: Tue, 12 January, 2010 23:11:26
Subject: [boost] Using boost::circular_buffer in boost::interprocess:managed_shared_memory
Can boost::circular_buffer be allocated in
boost::interprocess:managed_shared_memory by passing an Interprocess
aloocator to the constructor of boost::circular_buffer?
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk