Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem Using managed_shared_memory
From: med ennemri (med.ennemri_at_[hidden])
Date: 2010-03-18 11:10:43


Thanks, that resolves my problem.

2010/3/18 Steven Watanabe <watanabesj_at_[hidden]>

> AMDG
>
>
> med ennemri wrote:
>
>> I have a problem using managed_shared_memory , I can only read strings
>> that
>> has size less that 16 characters.
>>
>> This is my server code
>>
>>
>> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>> #include <boost/interprocess/managed_shared_memory.hpp>
>> #include <utility>
>> #include <iostream>
>>
>> int main ()
>> {
>> using namespace boost::interprocess;
>> typedef std::pair<std::string, int> FileState;
>>
>>
>
> You need to use boost::interprocess::basic_string
> parameterized with the correct allocator. It works
> for small string because of SBO, (i.e. small srings
> are stored within the string class itself, and do
> not allocate any memory.).
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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