Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67451 - in trunk/libs/interprocess: . doc example proj/vc7ide test
From: igaztanaga_at_[hidden]
Date: 2010-12-26 04:54:00


Author: igaztanaga
Date: 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
New Revision: 67451
URL: http://svn.boost.org/trac/boost/changeset/67451

Log:
Added XSI shared memory
Added:
   trunk/libs/interprocess/Jamfile.v2 (contents, props changed)
   trunk/libs/interprocess/example/doc_xsi_shared_memory.cpp (contents, props changed)
   trunk/libs/interprocess/proj/vc7ide/doc_xsi_shared_memory.vcproj (contents, props changed)
   trunk/libs/interprocess/proj/vc7ide/managed_xsi_shared_memory.vcproj (contents, props changed)
   trunk/libs/interprocess/proj/vc7ide/xsi_shared_memory_mapping_test.vcproj (contents, props changed)
   trunk/libs/interprocess/test/managed_xsi_shared_memory_test.cpp (contents, props changed)
   trunk/libs/interprocess/test/xsi_shared_memory_mapping_test.cpp (contents, props changed)
Text files modified:
   trunk/libs/interprocess/doc/interprocess.qbk | 52 +++++++++++++
   trunk/libs/interprocess/example/doc_file_mapping.cpp | 60 +++++++--------
   trunk/libs/interprocess/example/doc_managed_copy_on_write.cpp | 40 ++++++++--
   trunk/libs/interprocess/example/doc_managed_mapped_file.cpp | 19 ++++
   trunk/libs/interprocess/example/doc_shared_ptr.cpp | 42 ++++------
   trunk/libs/interprocess/example/doc_unique_ptr.cpp | 42 ++++------
   trunk/libs/interprocess/example/doc_windows_shared_memory.cpp | 5
   trunk/libs/interprocess/proj/vc7ide/Interprocess.sln | 154 ++++++---------------------------------
   trunk/libs/interprocess/proj/vc7ide/interprocesslib.vcproj | 9 ++
   trunk/libs/interprocess/test/managed_mapped_file_test.cpp | 40 +++++----
   trunk/libs/interprocess/test/mapped_file_test.cpp | 5 -
   trunk/libs/interprocess/test/shared_memory_test.cpp | 5 -
   12 files changed, 218 insertions(+), 255 deletions(-)

Added: trunk/libs/interprocess/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/interprocess/Jamfile.v2 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -0,0 +1,5 @@
+import testing ;
+
+# Tests from Jamfiles in individual library test subdirectories
+build-project example ; # test-suite interprocess_example
+build-project test ; # test-suite interprocess_test

Modified: trunk/libs/interprocess/doc/interprocess.qbk
==============================================================================
--- trunk/libs/interprocess/doc/interprocess.qbk (original)
+++ trunk/libs/interprocess/doc/interprocess.qbk 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -664,6 +664,38 @@
 
 [endsect]
 
+[section:xsi_shared_memory XSI shared memory]
+
+In many UNIX systems, the OS offers another shared memory memory mechanism, XSI
+(X/Open System Interfaces) shared memory segments, also known as "System V" shared memory.
+This shared memory mechanism is quite popular and portable, and it's not based in file-mapping
+semantics, but it uses special functions (`shmget`, `shmat`, `shmdt`, `shmctl`...).
+
+Unlike POSIX shared memory segments, XSI shared memory segments are not identified by names but
+by 'keys' usually created with `ftok`. XSI shared memory segments have kernel lifetime and
+must be explicitly removed. XSI shared memory does not support copy-on-write and partial shared memory mapping
+but it supports anonymous shared memory.
+
+[*Boost.Interprocess] offers simple ([classref boost::interprocess::xsi_shared_memory xsi_shared_memory])
+and managed ([classref boost::interprocess::managed_xsi_shared_memory managed_xsi_shared_memory])
+shared memory classes to ease the use of XSI shared memory. It also wraps key creation with the
+simple [classref boost::interprocess::xsi_key xsi_key] class.
+
+Let's repeat the same example presented for the portable shared memory object:
+A server process creates a shared memory object, maps it and initializes all the bytes to a value. After that,
+a client process opens the shared memory, maps it, and checks
+that the data is correctly initialized.
+
+This is the server process:
+
+[import ../example/doc_xsi_shared_memory.cpp]
+[doc_xsi_shared_memory]
+
+As we can see, native windows shared memory needs synchronization to make sure
+that the shared memory won't be destroyed before the client is launched.
+
+[endsect]
+
 [endsect]
 
 [section:mapped_file Memory Mapped Files]
@@ -3151,7 +3183,7 @@
 
 Windows users might also want to use native windows shared memory instead of
 the portable [classref boost::interprocess::shared_memory_object shared_memory_object]
-based managed memory. This is achieved through the
+managed memory. This is achieved through the
 [classref boost::interprocess::basic_managed_windows_shared_memory basic_managed_windows_shared_memory]
 class. To use it just include:
 
@@ -3172,6 +3204,24 @@
 
 [endsect]
 
+[section:xsi_managed_memory_common_shm Using XSI (system V) shared memory]
+
+Unix users might also want to use XSI (system V) instead of
+the portable [classref boost::interprocess::shared_memory_object shared_memory_object]
+managed memory. This is achieved through the
+[classref boost::interprocess::basic_managed_xsi_shared_memory basic_managed_xsi_shared_memory]
+class. To use it just include:
+
+[c++]
+
+ #include <boost/interprocess/managed_xsi_shared_memory.hpp>
+
+This class has nearly the same interface as
+[classref boost::interprocess::basic_managed_shared_memory basic_managed_shared_memory]
+but uses XSI shared memory as backend.
+
+[endsect]
+
 For more information about managed shared memory capabilities, see
 [classref boost::interprocess::basic_managed_shared_memory basic_managed_shared_memory] class reference.
 

Modified: trunk/libs/interprocess/example/doc_file_mapping.cpp
==============================================================================
--- trunk/libs/interprocess/example/doc_file_mapping.cpp (original)
+++ trunk/libs/interprocess/example/doc_file_mapping.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -25,49 +25,43 @@
 int main(int argc, char *argv[])
 {
    using namespace boost::interprocess;
+
+ //Define file names
+ //<-
+ #if 1
+ std::string file_name(boost::interprocess::detail::get_temporary_path());
+ file_name += "/"; file_name += test::get_process_id_name();
+ const char *FileName = file_name.c_str();
+ #else
+ //->
+ const char *FileName = "file.bin";
+ //<-
+ #endif
+ //->
    const std::size_t FileSize = 10000;
+
    if(argc == 1){ //Parent process executes this
       { //Create a file
+ file_mapping::remove(FileName);
          std::filebuf fbuf;
- //<-
- #if 1
- fbuf.open(test::get_process_id_name(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc | std::ios_base::binary);
- #else
- //->
- fbuf.open("file.bin", std::ios_base::in | std::ios_base::out
+ fbuf.open(FileName, std::ios_base::in | std::ios_base::out
                               | std::ios_base::trunc | std::ios_base::binary);
- //<-
- #endif
- //->
          //Set the size
          fbuf.pubseekoff(FileSize-1, std::ios_base::beg);
          fbuf.sputc(0);
       }
- //Remove file on exit
+
+ //Remove on exit
       struct file_remove
       {
- //<-
- #if 1
- ~file_remove (){ file_mapping::remove(test::get_process_id_name()); }
- #else
- //->
- ~file_remove (){ file_mapping::remove("file.bin"); }
- //<-
- #endif
- //->
- } destroy_on_exit;
+ file_remove(const char *FileName)
+ : FileName_(FileName) {}
+ ~file_remove(){ file_mapping::remove(FileName_); }
+ const char *FileName_;
+ } remover(FileName);
 
       //Create a file mapping
- //<-
- #if 1
- file_mapping m_file(test::get_process_id_name(), read_write);
- #else
- //->
- file_mapping m_file("file.bin", read_write);
- //<-
- #endif
- //->
+ file_mapping m_file(FileName, read_write);
 
       //Map the whole file with read-write permissions in this process
       mapped_region region(m_file, read_write);
@@ -82,7 +76,7 @@
       //Launch child process
       std::string s(argv[0]); s += " child ";
       //<-
- s += test::get_process_id_name();
+ s += "\""; s+= FileName; s += "\"";
       //->
       if(0 != std::system(s.c_str()))
          return 1;
@@ -94,7 +88,7 @@
          file_mapping m_file(argv[2], read_only);
          #else
          //->
- file_mapping m_file("file.bin", read_only);
+ file_mapping m_file(FileName, read_only);
          //<-
          #endif
          //->
@@ -118,7 +112,7 @@
          fbuf.open(argv[2], std::ios_base::in | std::ios_base::binary);
          #else
          //->
- fbuf.open("file.bin", std::ios_base::in | std::ios_base::binary);
+ fbuf.open(FileName, std::ios_base::in | std::ios_base::binary);
          //<-
          #endif
          //->

Modified: trunk/libs/interprocess/example/doc_managed_copy_on_write.cpp
==============================================================================
--- trunk/libs/interprocess/example/doc_managed_copy_on_write.cpp (original)
+++ trunk/libs/interprocess/example/doc_managed_copy_on_write.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -8,28 +8,50 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 #include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/os_file_functions.hpp>
 //[doc_managed_copy_on_write
 #include <boost/interprocess/managed_mapped_file.hpp>
 #include <fstream> //std::fstream
 #include <iterator>//std::distance
 
+//<-
+#include "../test/get_process_id_name.hpp"
+//->
+
 int main()
 {
    using namespace boost::interprocess;
 
+ //Define file names
+ //<-
+ #if 1
+ std::string managed_file(boost::interprocess::detail::get_temporary_path());
+ managed_file += "/"; managed_file += test::get_process_id_name();
+ const char *ManagedFile = managed_file.c_str();
+ std::string managed_file2(boost::interprocess::detail::get_temporary_path());
+ managed_file2 += "/"; managed_file2 += test::get_process_id_name(); managed_file2 += "_2";
+ const char *ManagedFile2 = managed_file2.c_str();
+ #else
+ //->
+ const char *ManagedFile = "MyManagedFile";
+ const char *ManagedFile2 = "MyManagedFile2";
+ //<-
+ #endif
+ //->
+
    //Try to erase any previous managed segment with the same name
- file_mapping::remove("MyManagedFile");
- file_mapping::remove("MyManagedFile2");
- remove_file_on_destroy destroyer1("MyManagedFile");
- remove_file_on_destroy destroyer2("MyManagedFile2");
+ file_mapping::remove(ManagedFile);
+ file_mapping::remove(ManagedFile2);
+ remove_file_on_destroy destroyer1(ManagedFile);
+ remove_file_on_destroy destroyer2(ManagedFile2);
 
    {
       //Create an named integer in a managed mapped file
- managed_mapped_file managed_file(create_only, "MyManagedFile", 65536);
+ managed_mapped_file managed_file(create_only, ManagedFile, 65536);
       managed_file.construct<int>("MyInt")(0u);
 
       //Now create a copy on write version
- managed_mapped_file managed_file_cow(open_copy_on_write, "MyManagedFile");
+ managed_mapped_file managed_file_cow(open_copy_on_write, ManagedFile);
 
       //Erase the int and create a new one
       if(!managed_file_cow.destroy<int>("MyInt"))
@@ -45,20 +67,20 @@
          throw int(0);
 
       { //Dump the modified copy on write segment to a file
- std::fstream file("MyManagedFile2", std::ios_base::out | std::ios_base::binary);
+ std::fstream file(ManagedFile2, std::ios_base::out | std::ios_base::binary);
          if(!file)
             throw int(0);
          file.write(static_cast<const char *>(managed_file_cow.get_address()), managed_file_cow.get_size());
       }
 
       //Now open the modified file and test changes
- managed_mapped_file managed_file_cow2(open_only, "MyManagedFile2");
+ managed_mapped_file managed_file_cow2(open_only, ManagedFile2);
       if(managed_file_cow2.find<int>("MyInt").first && !managed_file_cow2.find<int>("MyInt2").first)
          throw int(0);
    }
    {
       //Now create a read-only version
- managed_mapped_file managed_file_ro(open_read_only, "MyManagedFile");
+ managed_mapped_file managed_file_ro(open_read_only, ManagedFile);
       
       //Check the original is intact
       if(!managed_file_ro.find<int>("MyInt").first && managed_file_ro.find<int>("MyInt2").first)

Modified: trunk/libs/interprocess/example/doc_managed_mapped_file.cpp
==============================================================================
--- trunk/libs/interprocess/example/doc_managed_mapped_file.cpp (original)
+++ trunk/libs/interprocess/example/doc_managed_mapped_file.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -16,15 +16,32 @@
 #include <cstddef>
 #include <cstdio>
 
+//<-
+#include "../test/get_process_id_name.hpp"
+//->
+
 using namespace boost::interprocess;
 typedef list<int, allocator<int, managed_mapped_file::segment_manager> >
    MyList;
 
 int main ()
-{
+{
+ //Define file names
+ //<-
+ #if 1
+ std::string file(boost::interprocess::detail::get_temporary_path());
+ file += "/"; file += test::get_process_id_name();
+ const char *FileName = file.c_str();
+ #else
+ //->
    const char *FileName = "file_mapping";
+ //<-
+ #endif
+ //->
+
    const std::size_t FileSize = 1000;
    file_mapping::remove(FileName);
+
    try{
       std::size_t old_size = 0;
       managed_mapped_file::handle_t list_handle;

Modified: trunk/libs/interprocess/example/doc_shared_ptr.cpp
==============================================================================
--- trunk/libs/interprocess/example/doc_shared_ptr.cpp (original)
+++ trunk/libs/interprocess/example/doc_shared_ptr.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -48,31 +48,29 @@
 
 int main ()
 {
- //Destroy any previous file with the name to be used.
- struct file_remove
- {
+ //Define file names
    //<-
    #if 1
- file_remove() { file_mapping::remove(test::get_process_id_name()); }
- ~file_remove(){ file_mapping::remove(test::get_process_id_name()); }
+ std::string mapped_file(boost::interprocess::detail::get_temporary_path());
+ mapped_file += "/"; mapped_file += test::get_process_id_name();
+ const char *MappedFile = mapped_file.c_str();
    #else
    //->
- file_remove() { file_mapping::remove("MyMappedFile"); }
- ~file_remove(){ file_mapping::remove("MyMappedFile"); }
+ const char *MappedFile = "MyMappedFile";
    //<-
    #endif
    //->
- } remover;
+
+ //Destroy any previous file with the name to be used.
+ struct file_remove
+ {
+ file_remove(const char *MappedFile)
+ : MappedFile_(MappedFile) { file_mapping::remove(MappedFile_); }
+ ~file_remove(){ file_mapping::remove(MappedFile_); }
+ const char *MappedFile_;
+ } remover(MappedFile);
    {
- //<-
- #if 1
- managed_mapped_file file(create_only, test::get_process_id_name(), 4096);
- #else
- //->
- managed_mapped_file file(create_only, "MyMappedFile", 4096);
- //<-
- #endif
- //->
+ managed_mapped_file file(create_only, MappedFile, 65536);
 
       //Construct the shared type in the file and
       //pass ownership to this local shared pointer
@@ -101,15 +99,7 @@
    }
    {
       //Reopen the mapped file and find again all owners
- //<-
- #if 1
- managed_mapped_file file(open_only, test::get_process_id_name());
- #else
- //->
- managed_mapped_file file(open_only, "MyMappedFile");
- //<-
- #endif
- //->
+ managed_mapped_file file(open_only, MappedFile);
 
       shared_ptr_owner *owner1 = file.find<shared_ptr_owner>("owner1").first;
       shared_ptr_owner *owner2 = file.find<shared_ptr_owner>("owner2").first;

Modified: trunk/libs/interprocess/example/doc_unique_ptr.cpp
==============================================================================
--- trunk/libs/interprocess/example/doc_unique_ptr.cpp (original)
+++ trunk/libs/interprocess/example/doc_unique_ptr.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -50,31 +50,29 @@
 
 int main ()
 {
- //Destroy any previous file with the name to be used.
- struct file_remove
- {
+ //Define file names
    //<-
    #if 1
- file_remove() { file_mapping::remove(test::get_process_id_name()); }
- ~file_remove(){ file_mapping::remove(test::get_process_id_name()); }
+ std::string mapped_file(boost::interprocess::detail::get_temporary_path());
+ mapped_file += "/"; mapped_file += test::get_process_id_name();
+ const char *MappedFile = mapped_file.c_str();
    #else
    //->
- file_remove() { file_mapping::remove("MyMappedFile"); }
- ~file_remove(){ file_mapping::remove("MyMappedFile"); }
+ const char *MappedFile = "MyMappedFile";
    //<-
    #endif
    //->
- } remover;
+
+ //Destroy any previous file with the name to be used.
+ struct file_remove
+ {
+ file_remove(const char *MappedFile)
+ : MappedFile_(MappedFile) { file_mapping::remove(MappedFile_); }
+ ~file_remove(){ file_mapping::remove(MappedFile_); }
+ const char *MappedFile_;
+ } remover(MappedFile);
    {
- //<-
- #if 1
- managed_mapped_file file(create_only, test::get_process_id_name(), 65536);
- #else
- //->
- managed_mapped_file file(create_only, "MyMappedFile", 65536);
- //<-
- #endif
- //->
+ managed_mapped_file file(create_only, MappedFile, 65536);
 
       //Construct an object in the file and
       //pass ownership to this local unique pointer
@@ -122,15 +120,7 @@
    }
    {
       //Reopen the mapped file and find again the list
- //<-
- #if 1
- managed_mapped_file file(open_only, test::get_process_id_name());
- #else
- //->
- managed_mapped_file file(open_only, "MyMappedFile");
- //<-
- #endif
- //->
+ managed_mapped_file file(open_only, MappedFile);
 
       unique_ptr_list_t *unique_list =
          file.find<unique_ptr_list_t>("unique list").first;

Modified: trunk/libs/interprocess/example/doc_windows_shared_memory.cpp
==============================================================================
--- trunk/libs/interprocess/example/doc_windows_shared_memory.cpp (original)
+++ trunk/libs/interprocess/example/doc_windows_shared_memory.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -8,8 +8,9 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 #include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
 
-#ifdef BOOST_INTERPROCESS_WINDOWS
+#if defined(BOOST_INTERPROCESS_WINDOWS) || defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
 
 //[doc_windows_shared_memory
 #include <boost/interprocess/windows_shared_memory.hpp>
@@ -56,7 +57,7 @@
       //Open already created shared memory object.
       //<-
       #if 1
- windows_shared_memory shm (open_only, test::get_process_id_name(), read_only);
+ windows_shared_memory shm (open_only, argv[2], read_only);
       #else
       //->
       windows_shared_memory shm (open_only, "MySharedMemory", read_only);

Added: trunk/libs/interprocess/example/doc_xsi_shared_memory.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/interprocess/example/doc_xsi_shared_memory.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -0,0 +1,95 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+
+#if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) || defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
+
+//[doc_xsi_shared_memory
+#include <boost/interprocess/xsi_shared_memory.hpp>
+#include <boost/interprocess/mapped_region.hpp>
+#include <cstring>
+#include <cstdlib>
+#include <string>
+
+using namespace boost::interprocess;
+
+void remove_old_shared_memory(const xsi_key &key)
+{
+ try{
+ xsi_shared_memory xsi(open_only, key);
+ xsi_shared_memory::remove(xsi.get_shmid());
+ }
+ catch(interprocess_exception &e){
+ if(e.get_error_code() != not_found_error)
+ throw;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ if(argc == 1){ //Parent process
+ //Build XSI key (ftok based)
+ xsi_key key(argv[0], 1);
+
+ remove_old_shared_memory(key);
+
+ //Create a shared memory object.
+ xsi_shared_memory shm (create_only, key, 1000);
+
+ //Remove shared memory on destruction
+ struct shm_remove
+ {
+ int shmid_;
+ shm_remove(int shmid) : shmid_(shmid){}
+ ~shm_remove(){ xsi_shared_memory::remove(shmid_); }
+ } remover(shm.get_shmid());
+
+ //Map the whole shared memory in this process
+ mapped_region region(shm, read_write);
+
+ //Write all the memory to 1
+ std::memset(region.get_address(), 1, region.get_size());
+
+ //Launch child process
+ std::string s(argv[0]); s += " child ";
+ if(0 != std::system(s.c_str()))
+ return 1;
+ }
+ else{
+ //Build XSI key (ftok based)
+ xsi_key key(argv[0], 1);
+
+ //Create a shared memory object.
+ xsi_shared_memory shm (open_only, key);
+
+ //Map the whole shared memory in this process
+ mapped_region region(shm, read_only);
+
+ //Check that memory was initialized to 1
+ char *mem = static_cast<char*>(region.get_address());
+ for(std::size_t i = 0; i < region.get_size(); ++i)
+ if(*mem++ != 1)
+ return 1; //Error checking memory
+ }
+ return 0;
+}
+//]
+
+#else //BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
+
+int main()
+{
+ return 0;
+}
+
+#endif //BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
+
+#include <boost/interprocess/detail/config_end.hpp>

Modified: trunk/libs/interprocess/proj/vc7ide/Interprocess.sln
==============================================================================
--- trunk/libs/interprocess/proj/vc7ide/Interprocess.sln (original)
+++ trunk/libs/interprocess/proj/vc7ide/Interprocess.sln 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -1,68 +1,4 @@
 Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_map", "doc_map.vcproj", "{59CEC183-8192-8F6D-4FB7-BA260A79D352}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "windows_shared_memory_test", "windows_shared_memory_test.vcproj", "{E385C28C-0691-4FA7-F48E-935BA0D06310}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "windows_shared_memory_mapping_test", "windows_shared_memory_mapping_test.vcproj", "{518CE8C3-6512-FA75-46EF-B917A3A116D1}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "managed_windows_shared_memory_test", "managed_windows_shared_memory.vcproj", "{5D18CE83-1926-7AE4-FE94-B606D9B23131}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "adaptive_pool_test", "adaptive_pool_test.vcproj", "{58CE1D84-1962-4FE9-BA0D-A4F7973A4652}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cached_adaptive_pool_test", "cached_adaptive_pool_test.vcproj", "{5188E3CE-2964-F43E-FB87-B037AC692D59}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "private_adaptive_pool_test", "private_adaptive_pool_test.vcproj", "{5CE14C83-4962-8F5E-4FA7-B0D3A7B93635}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_allocator", "doc_allocator.vcproj", "{581B1C83-4E12-9526-020F-012482540054}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_node_allocator", "doc_node_allocator.vcproj", "{51B17C83-E172-5396-0FA2-825472008554}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_private_node_allocator", "doc_private_node_allocator.vcproj", "{2B75C833-17D2-4956-A23F-820854254175}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_cached_node_allocator", "doc_cached_node_allocator.vcproj", "{283AD375-7D12-5866-23BF-854308651275}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_adaptive_pool", "doc_adaptive_pool.vcproj", "{57C832B1-17D2-9537-FA12-827220448554}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_cached_adaptive_pool", "doc_cached_adaptive_pool.vcproj", "{536C8251-7E12-9537-A1E2-822073258554}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_private_adaptive_pool", "doc_private_adaptive_pool.vcproj", "{83258CB1-127E-9375-F872-8324A1054454}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_managed_raw_allocation", "doc_managed_raw_allocation.vcproj", "{5198EFC3-2731-F34E-4FD8-1859AC94F761}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_managed_aligned_allocation", "doc_managed_aligned_allocation.vcproj", "{58DE18C3-3261-2F3E-FD47-83760B9FA761}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_interprocesslib", "interprocesslib.vcproj", "{FFAA56F1-32EC-4B22-B6BD-95A311A67C35}"
         ProjectSection(ProjectDependencies) = postProject
         EndProjectSection
@@ -447,76 +383,26 @@
         ProjectSection(ProjectDependencies) = postProject
         EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xsi_shared_memory_mapping_test", "xsi_shared_memory_mapping_test.vcproj", "{518CE8C3-5DA7-6256-46EF-97A116702AD1}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "managed_xsi_shared_memory_test", "managed_xsi_shared_memory.vcproj", "{58DF28E3-0926-F47A-E28A-B03A4D619631}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_xsi_shared_memory", "doc_xsi_shared_memory.vcproj", "{8C5CE183-0326-47FC-12FE-8B6F7963A071}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
 Global
         GlobalSection(SolutionConfiguration) = preSolution
                 Debug = Debug
                 Release = Release
         EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ EndGlobalSection
         GlobalSection(ProjectConfiguration) = postSolution
- {59CEC183-8192-8F6D-4FB7-BA260A79D352}.Debug.ActiveCfg = Debug|Win32
- {59CEC183-8192-8F6D-4FB7-BA260A79D352}.Debug.Build.0 = Debug|Win32
- {59CEC183-8192-8F6D-4FB7-BA260A79D352}.Release.ActiveCfg = Release|Win32
- {59CEC183-8192-8F6D-4FB7-BA260A79D352}.Release.Build.0 = Release|Win32
- {E385C28C-0691-4FA7-F48E-935BA0D06310}.Debug.ActiveCfg = Debug|Win32
- {E385C28C-0691-4FA7-F48E-935BA0D06310}.Debug.Build.0 = Debug|Win32
- {E385C28C-0691-4FA7-F48E-935BA0D06310}.Release.ActiveCfg = Release|Win32
- {E385C28C-0691-4FA7-F48E-935BA0D06310}.Release.Build.0 = Release|Win32
- {518CE8C3-6512-FA75-46EF-B917A3A116D1}.Debug.ActiveCfg = Debug|Win32
- {518CE8C3-6512-FA75-46EF-B917A3A116D1}.Debug.Build.0 = Debug|Win32
- {518CE8C3-6512-FA75-46EF-B917A3A116D1}.Release.ActiveCfg = Release|Win32
- {518CE8C3-6512-FA75-46EF-B917A3A116D1}.Release.Build.0 = Release|Win32
- {5D18CE83-1926-7AE4-FE94-B606D9B23131}.Debug.ActiveCfg = Debug|Win32
- {5D18CE83-1926-7AE4-FE94-B606D9B23131}.Debug.Build.0 = Debug|Win32
- {5D18CE83-1926-7AE4-FE94-B606D9B23131}.Release.ActiveCfg = Release|Win32
- {5D18CE83-1926-7AE4-FE94-B606D9B23131}.Release.Build.0 = Release|Win32
- {58CE1D84-1962-4FE9-BA0D-A4F7973A4652}.Debug.ActiveCfg = Debug|Win32
- {58CE1D84-1962-4FE9-BA0D-A4F7973A4652}.Debug.Build.0 = Debug|Win32
- {58CE1D84-1962-4FE9-BA0D-A4F7973A4652}.Release.ActiveCfg = Release|Win32
- {58CE1D84-1962-4FE9-BA0D-A4F7973A4652}.Release.Build.0 = Release|Win32
- {5188E3CE-2964-F43E-FB87-B037AC692D59}.Debug.ActiveCfg = Debug|Win32
- {5188E3CE-2964-F43E-FB87-B037AC692D59}.Debug.Build.0 = Debug|Win32
- {5188E3CE-2964-F43E-FB87-B037AC692D59}.Release.ActiveCfg = Release|Win32
- {5188E3CE-2964-F43E-FB87-B037AC692D59}.Release.Build.0 = Release|Win32
- {5CE14C83-4962-8F5E-4FA7-B0D3A7B93635}.Debug.ActiveCfg = Debug|Win32
- {5CE14C83-4962-8F5E-4FA7-B0D3A7B93635}.Debug.Build.0 = Debug|Win32
- {5CE14C83-4962-8F5E-4FA7-B0D3A7B93635}.Release.ActiveCfg = Release|Win32
- {5CE14C83-4962-8F5E-4FA7-B0D3A7B93635}.Release.Build.0 = Release|Win32
- {581B1C83-4E12-9526-020F-012482540054}.Debug.ActiveCfg = Debug|Win32
- {581B1C83-4E12-9526-020F-012482540054}.Debug.Build.0 = Debug|Win32
- {581B1C83-4E12-9526-020F-012482540054}.Release.ActiveCfg = Release|Win32
- {581B1C83-4E12-9526-020F-012482540054}.Release.Build.0 = Release|Win32
- {51B17C83-E172-5396-0FA2-825472008554}.Debug.ActiveCfg = Debug|Win32
- {51B17C83-E172-5396-0FA2-825472008554}.Debug.Build.0 = Debug|Win32
- {51B17C83-E172-5396-0FA2-825472008554}.Release.ActiveCfg = Release|Win32
- {51B17C83-E172-5396-0FA2-825472008554}.Release.Build.0 = Release|Win32
- {2B75C833-17D2-4956-A23F-820854254175}.Debug.ActiveCfg = Debug|Win32
- {2B75C833-17D2-4956-A23F-820854254175}.Debug.Build.0 = Debug|Win32
- {2B75C833-17D2-4956-A23F-820854254175}.Release.ActiveCfg = Release|Win32
- {2B75C833-17D2-4956-A23F-820854254175}.Release.Build.0 = Release|Win32
- {283AD375-7D12-5866-23BF-854308651275}.Debug.ActiveCfg = Debug|Win32
- {283AD375-7D12-5866-23BF-854308651275}.Debug.Build.0 = Debug|Win32
- {283AD375-7D12-5866-23BF-854308651275}.Release.ActiveCfg = Release|Win32
- {283AD375-7D12-5866-23BF-854308651275}.Release.Build.0 = Release|Win32
- {57C832B1-17D2-9537-FA12-827220448554}.Debug.ActiveCfg = Debug|Win32
- {57C832B1-17D2-9537-FA12-827220448554}.Debug.Build.0 = Debug|Win32
- {57C832B1-17D2-9537-FA12-827220448554}.Release.ActiveCfg = Release|Win32
- {57C832B1-17D2-9537-FA12-827220448554}.Release.Build.0 = Release|Win32
- {536C8251-7E12-9537-A1E2-822073258554}.Debug.ActiveCfg = Debug|Win32
- {536C8251-7E12-9537-A1E2-822073258554}.Debug.Build.0 = Debug|Win32
- {536C8251-7E12-9537-A1E2-822073258554}.Release.ActiveCfg = Release|Win32
- {536C8251-7E12-9537-A1E2-822073258554}.Release.Build.0 = Release|Win32
- {83258CB1-127E-9375-F872-8324A1054454}.Debug.ActiveCfg = Debug|Win32
- {83258CB1-127E-9375-F872-8324A1054454}.Debug.Build.0 = Debug|Win32
- {83258CB1-127E-9375-F872-8324A1054454}.Release.ActiveCfg = Release|Win32
- {83258CB1-127E-9375-F872-8324A1054454}.Release.Build.0 = Release|Win32
- {5198EFC3-2731-F34E-4FD8-1859AC94F761}.Debug.ActiveCfg = Debug|Win32
- {5198EFC3-2731-F34E-4FD8-1859AC94F761}.Debug.Build.0 = Debug|Win32
- {5198EFC3-2731-F34E-4FD8-1859AC94F761}.Release.ActiveCfg = Release|Win32
- {5198EFC3-2731-F34E-4FD8-1859AC94F761}.Release.Build.0 = Release|Win32
- {58DE18C3-3261-2F3E-FD47-83760B9FA761}.Debug.ActiveCfg = Debug|Win32
- {58DE18C3-3261-2F3E-FD47-83760B9FA761}.Debug.Build.0 = Debug|Win32
- {58DE18C3-3261-2F3E-FD47-83760B9FA761}.Release.ActiveCfg = Release|Win32
- {58DE18C3-3261-2F3E-FD47-83760B9FA761}.Release.Build.0 = Release|Win32
                 {FFAA56F1-32EC-4B22-B6BD-95A311A67C35}.Debug.ActiveCfg = Debug|Win32
                 {FFAA56F1-32EC-4B22-B6BD-95A311A67C35}.Debug.Build.0 = Debug|Win32
                 {FFAA56F1-32EC-4B22-B6BD-95A311A67C35}.Release.ActiveCfg = Release|Win32
@@ -901,6 +787,18 @@
                 {83581CCE-487E-3292-A4E7-BA07926D3A14}.Debug.Build.0 = Debug|Win32
                 {83581CCE-487E-3292-A4E7-BA07926D3A14}.Release.ActiveCfg = Release|Win32
                 {83581CCE-487E-3292-A4E7-BA07926D3A14}.Release.Build.0 = Release|Win32
+ {518CE8C3-5DA7-6256-46EF-97A116702AD1}.Debug.ActiveCfg = Debug|Win32
+ {518CE8C3-5DA7-6256-46EF-97A116702AD1}.Debug.Build.0 = Debug|Win32
+ {518CE8C3-5DA7-6256-46EF-97A116702AD1}.Release.ActiveCfg = Release|Win32
+ {518CE8C3-5DA7-6256-46EF-97A116702AD1}.Release.Build.0 = Release|Win32
+ {58DF28E3-0926-F47A-E28A-B03A4D619631}.Debug.ActiveCfg = Debug|Win32
+ {58DF28E3-0926-F47A-E28A-B03A4D619631}.Debug.Build.0 = Debug|Win32
+ {58DF28E3-0926-F47A-E28A-B03A4D619631}.Release.ActiveCfg = Release|Win32
+ {58DF28E3-0926-F47A-E28A-B03A4D619631}.Release.Build.0 = Release|Win32
+ {8C5CE183-0326-47FC-12FE-8B6F7963A071}.Debug.ActiveCfg = Debug|Win32
+ {8C5CE183-0326-47FC-12FE-8B6F7963A071}.Debug.Build.0 = Debug|Win32
+ {8C5CE183-0326-47FC-12FE-8B6F7963A071}.Release.ActiveCfg = Release|Win32
+ {8C5CE183-0326-47FC-12FE-8B6F7963A071}.Release.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(ExtensibilityGlobals) = postSolution
         EndGlobalSection

Added: trunk/libs/interprocess/proj/vc7ide/doc_xsi_shared_memory.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/interprocess/proj/vc7ide/doc_xsi_shared_memory.vcproj 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="doc_xsi_shared_memory"
+ ProjectGUID="{8C5CE183-0326-47FC-12FE-8B6F7963A071}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/doc_xsi_shared_memory"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/doc_xsi_shared_memory_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/doc_xsi_shared_memory.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/doc_xsi_shared_memory"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/doc_xsi_shared_memory.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{47371DEF-ADA5-60A6-6437-3A2A2D7225FF}">
+ <File
+ RelativePath="..\..\example\doc_xsi_shared_memory.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Modified: trunk/libs/interprocess/proj/vc7ide/interprocesslib.vcproj
==============================================================================
--- trunk/libs/interprocess/proj/vc7ide/interprocesslib.vcproj (original)
+++ trunk/libs/interprocess/proj/vc7ide/interprocesslib.vcproj 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -356,6 +356,9 @@
                         <File
                                 RelativePath="..\..\..\..\boost\interprocess\windows_shared_memory.hpp">
                         </File>
+ <File
+ RelativePath="..\..\..\..\boost\interprocess\xsi_shared_memory.hpp">
+ </File>
                 </Filter>
                 <Filter
                         Name="Detail"
@@ -459,6 +462,12 @@
                         <File
                                 RelativePath="..\..\..\..\boost\interprocess\detail\workaround.hpp">
                         </File>
+ <File
+ RelativePath="..\..\..\..\boost\interprocess\detail\xsi_shared_memory_device.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\interprocess\detail\xsi_shared_memory_file_wrapper.hpp">
+ </File>
                 </Filter>
                 <Filter
                         Name="Documentation"

Added: trunk/libs/interprocess/proj/vc7ide/managed_xsi_shared_memory.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/interprocess/proj/vc7ide/managed_xsi_shared_memory.vcproj 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="managed_xsi_shared_memory_test"
+ ProjectGUID="{58DF28E3-0926-F47A-E28A-B03A4D619631}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/managed_xsi_shared_memory_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/managed_xsi_shared_memory_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/managed_xsi_shared_memory_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/managed_xsi_shared_memory_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/managed_xsi_shared_memory_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4F277FC0-57BA-6A06-3746-252A3ED015AB}">
+ <File
+ RelativePath="..\..\test\managed_xsi_shared_memory_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/interprocess/proj/vc7ide/xsi_shared_memory_mapping_test.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/interprocess/proj/vc7ide/xsi_shared_memory_mapping_test.vcproj 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="xsi_shared_memory_mapping_test"
+ ProjectGUID="{518CE8C3-5DA7-6256-46EF-97A116702AD1}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/xsi_shared_memory_mapping_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/mapped_file_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/xsi_shared_memory_mapping_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/xsi_shared_memory_mapping_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/xsi_shared_memory_mapping_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4F8F372-C425-7A56-652E-AA2537EA023F}">
+ <File
+ RelativePath="..\..\test\xsi_shared_memory_mapping_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Modified: trunk/libs/interprocess/test/managed_mapped_file_test.cpp
==============================================================================
--- trunk/libs/interprocess/test/managed_mapped_file_test.cpp (original)
+++ trunk/libs/interprocess/test/managed_mapped_file_test.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -29,6 +29,8 @@
 int main ()
 {
    const int FileSize = 65536*10;
+ std::string filename(get_filename());
+ const char *FileName = filename.c_str();
 
    //STL compatible allocator object for memory-mapped file
    typedef allocator<int, managed_mapped_file::segment_manager>
@@ -38,12 +40,12 @@
 
    {
       //Remove the file it is already created
- file_mapping::remove(get_filename().c_str());
+ file_mapping::remove(FileName);
 
       const int max = 100;
       void *array[max];
       //Named allocate capable shared memory allocator
- managed_mapped_file mfile(create_only, get_filename().c_str(), FileSize);
+ managed_mapped_file mfile(create_only, FileName, FileSize);
 
       int i;
       //Let's allocate some memory
@@ -59,10 +61,10 @@
 
    {
       //Remove the file it is already created
- file_mapping::remove(get_filename().c_str());
+ file_mapping::remove(FileName);
 
       //Named allocate capable memory mapped file managed memory class
- managed_mapped_file mfile(create_only, get_filename().c_str(), FileSize);
+ managed_mapped_file mfile(create_only, FileName, FileSize);
 
       //Construct the STL-like allocator with the segment manager
       const allocator_int_t myallocator (mfile.get_segment_manager());
@@ -87,7 +89,7 @@
    }
    {
       //Map preexisting file again in memory
- managed_mapped_file mfile(open_only, get_filename().c_str());
+ managed_mapped_file mfile(open_only, FileName);
 
       //Check vector is still there
       MyVect *mfile_vect = mfile.find<MyVect>("MyVector").first;
@@ -98,7 +100,7 @@
    {
       {
          //Map preexisting file again in copy-on-write
- managed_mapped_file mfile(open_copy_on_write, get_filename().c_str());
+ managed_mapped_file mfile(open_copy_on_write, FileName);
 
          //Check vector is still there
          MyVect *mfile_vect = mfile.find<MyVect>("MyVector").first;
@@ -116,7 +118,7 @@
       //Now check vector is still in the file
       {
          //Map preexisting file again in copy-on-write
- managed_mapped_file mfile(open_copy_on_write, get_filename().c_str());
+ managed_mapped_file mfile(open_copy_on_write, FileName);
 
          //Check vector is still there
          MyVect *mfile_vect = mfile.find<MyVect>("MyVector").first;
@@ -126,7 +128,7 @@
    }
    {
       //Map preexisting file again in copy-on-write
- managed_mapped_file mfile(open_read_only, get_filename().c_str());
+ managed_mapped_file mfile(open_read_only, FileName);
 
       //Check vector is still there
       MyVect *mfile_vect = mfile.find<MyVect>("MyVector").first;
@@ -137,15 +139,15 @@
       std::size_t old_free_memory;
       {
          //Map preexisting file again in memory
- managed_mapped_file mfile(open_only, get_filename().c_str());
+ managed_mapped_file mfile(open_only, FileName);
          old_free_memory = mfile.get_free_memory();
       }
 
       //Now grow the file
- managed_mapped_file::grow(get_filename().c_str(), FileSize);
+ managed_mapped_file::grow(FileName, FileSize);
 
       //Map preexisting file again in memory
- managed_mapped_file mfile(open_only, get_filename().c_str());
+ managed_mapped_file mfile(open_only, FileName);
 
       //Check vector is still there
       MyVect *mfile_vect = mfile.find<MyVect>("MyVector").first;
@@ -162,17 +164,17 @@
                   old_file_size, next_file_size, final_file_size;
       {
          //Map preexisting file again in memory
- managed_mapped_file mfile(open_only, get_filename().c_str());
+ managed_mapped_file mfile(open_only, FileName);
          old_free_memory = mfile.get_free_memory();
          old_file_size = mfile.get_size();
       }
 
       //Now shrink the file
- managed_mapped_file::shrink_to_fit(get_filename().c_str());
+ managed_mapped_file::shrink_to_fit(FileName);
 
       {
          //Map preexisting file again in memory
- managed_mapped_file mfile(open_only, get_filename().c_str());
+ managed_mapped_file mfile(open_only, FileName);
          next_file_size = mfile.get_size();
 
          //Check vector is still there
@@ -190,7 +192,7 @@
       //Now destroy the vector
       {
          //Map preexisting file again in memory
- managed_mapped_file mfile(open_only, get_filename().c_str());
+ managed_mapped_file mfile(open_only, FileName);
 
          //Destroy and check it is not present
          mfile.destroy<MyVect>("MyVector");
@@ -199,17 +201,17 @@
       }
 
       //Now shrink the file
- managed_mapped_file::shrink_to_fit(get_filename().c_str());
+ managed_mapped_file::shrink_to_fit(FileName);
       {
          //Map preexisting file again in memory
- managed_mapped_file mfile(open_only, get_filename().c_str());
+ managed_mapped_file mfile(open_only, FileName);
          final_file_size = mfile.get_size();
          if(next_file_size <= final_file_size)
             return -1;
       }
       {
          //Now test move semantics
- managed_mapped_file original(open_only, get_filename().c_str());
+ managed_mapped_file original(open_only, FileName);
          managed_mapped_file move_ctor(boost::interprocess::move(original));
          managed_mapped_file move_assign;
          move_assign = boost::interprocess::move(move_ctor);
@@ -217,7 +219,7 @@
       }
    }
 
- file_mapping::remove(get_filename().c_str());
+ file_mapping::remove(FileName);
    return 0;
 }
 

Added: trunk/libs/interprocess/test/managed_xsi_shared_memory_test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/interprocess/test/managed_xsi_shared_memory_test.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -0,0 +1,174 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2008-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+
+#if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/allocators/allocator.hpp>
+#include <boost/interprocess/containers/vector.hpp>
+#include <boost/interprocess/managed_xsi_shared_memory.hpp>
+#include <boost/interprocess/detail/file_wrapper.hpp>
+#include <boost/interprocess/file_mapping.hpp>
+#include <cstdio>
+#include <string>
+#include "get_process_id_name.hpp"
+
+using namespace boost::interprocess;
+
+void remove_shared_memory(const xsi_key &key)
+{
+ try{
+ xsi_shared_memory xsi(open_only, key);
+ xsi_shared_memory::remove(xsi.get_shmid());
+ }
+ catch(interprocess_exception &e){
+ if(e.get_error_code() != not_found_error)
+ throw;
+ }
+}
+
+class xsi_shared_memory_remover
+{
+ public:
+ xsi_shared_memory_remover(xsi_shared_memory &xsi_shm)
+ : xsi_shm_(xsi_shm)
+ {}
+
+ ~xsi_shared_memory_remover()
+ { xsi_shared_memory::remove(xsi_shm_.get_shmid()); }
+ private:
+ xsi_shared_memory & xsi_shm_;
+};
+
+inline std::string get_filename()
+{
+ std::string ret (detail::get_temporary_path());
+ ret += "/";
+ ret += test::get_process_id_name();
+ return ret;
+}
+
+int main ()
+{
+ const int ShmemSize = 65536;
+ std::string filename = get_filename();
+ const char *const ShmemName = filename.c_str();
+
+ file_mapping::remove(ShmemName);
+ { detail::file_wrapper(create_only, ShmemName, read_write); }
+ xsi_key key(ShmemName, 1);
+ file_mapping::remove(ShmemName);
+ int shmid;
+
+ //STL compatible allocator object for memory-mapped shmem
+ typedef allocator<int, managed_xsi_shared_memory::segment_manager>
+ allocator_int_t;
+ //A vector that uses that allocator
+ typedef boost::interprocess::vector<int, allocator_int_t> MyVect;
+
+ {
+ //Remove the shmem it is already created
+ remove_shared_memory(key);
+
+ const int max = 100;
+ void *array[max];
+ //Named allocate capable shared memory allocator
+ managed_xsi_shared_memory shmem(create_only, key, ShmemSize);
+ shmid = shmem.get_shmid();
+ int i;
+ //Let's allocate some memory
+ for(i = 0; i < max; ++i){
+ array[i] = shmem.allocate(i+1);
+ }
+
+ //Deallocate allocated memory
+ for(i = 0; i < max; ++i){
+ shmem.deallocate(array[i]);
+ }
+ }
+
+ {
+ //Remove the shmem it is already created
+ xsi_shared_memory::remove(shmid);
+
+ //Named allocate capable memory mapped shmem managed memory class
+ managed_xsi_shared_memory shmem(create_only, key, ShmemSize);
+ shmid = shmem.get_shmid();
+
+ //Construct the STL-like allocator with the segment manager
+ const allocator_int_t myallocator (shmem.get_segment_manager());
+
+ //Construct vector
+ MyVect *shmem_vect = shmem.construct<MyVect> ("MyVector") (myallocator);
+
+ //Test that vector can be found via name
+ if(shmem_vect != shmem.find<MyVect>("MyVector").first)
+ return -1;
+
+ //Destroy and check it is not present
+ shmem.destroy<MyVect> ("MyVector");
+ if(0 != shmem.find<MyVect>("MyVector").first)
+ return -1;
+
+ //Construct a vector in the memory-mapped shmem
+ shmem_vect = shmem.construct<MyVect> ("MyVector") (myallocator);
+ }
+ {
+ //Map preexisting shmem again in memory
+ managed_xsi_shared_memory shmem(open_only, key);
+ shmid = shmem.get_shmid();
+
+ //Check vector is still there
+ MyVect *shmem_vect = shmem.find<MyVect>("MyVector").first;
+ if(!shmem_vect)
+ return -1;
+ }
+
+
+ {
+ //Now destroy the vector
+ {
+ //Map preexisting shmem again in memory
+ managed_xsi_shared_memory shmem(open_only, key);
+ shmid = shmem.get_shmid();
+
+ //Destroy and check it is not present
+ shmem.destroy<MyVect>("MyVector");
+ if(0 != shmem.find<MyVect>("MyVector").first)
+ return -1;
+ }
+
+ {
+ //Now test move semantics
+ managed_xsi_shared_memory original(open_only, key);
+ managed_xsi_shared_memory move_ctor(boost::interprocess::move(original));
+ managed_xsi_shared_memory move_assign;
+ move_assign = boost::interprocess::move(move_ctor);
+ move_assign.swap(original);
+ }
+ }
+
+ xsi_shared_memory::remove(shmid);
+ return 0;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif //#ifndef BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
+
+#include <boost/interprocess/detail/config_end.hpp>

Modified: trunk/libs/interprocess/test/mapped_file_test.cpp
==============================================================================
--- trunk/libs/interprocess/test/mapped_file_test.cpp (original)
+++ trunk/libs/interprocess/test/mapped_file_test.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -75,11 +75,6 @@
    {
       mapped_file file1(create_only, get_filename().c_str(), FileSize, read_write, 0, permissions());
 
- //Compare name
- if(std::strcmp(file1.get_name(), get_filename().c_str()) != 0){
- return 1;
- }
-
       //Overwrite all memory
       std::memset(file1.get_user_address(), 0, file1.get_user_size());
 

Modified: trunk/libs/interprocess/test/shared_memory_test.cpp
==============================================================================
--- trunk/libs/interprocess/test/shared_memory_test.cpp (original)
+++ trunk/libs/interprocess/test/shared_memory_test.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -66,11 +66,6 @@
          shared_memory_object::remove(ShmName);
          shared_memory shm1(create_only, ShmName, ShmSize, read_write, 0, permissions());
 
- //Compare name
- if(std::strcmp(shm1.get_name(), ShmName) != 0){
- return 1;
- }
-
          //Overwrite all memory
          std::memset(shm1.get_user_address(), 0, shm1.get_user_size());
 

Added: trunk/libs/interprocess/test/xsi_shared_memory_mapping_test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/interprocess/test/xsi_shared_memory_mapping_test.cpp 2010-12-26 04:53:56 EST (Sun, 26 Dec 2010)
@@ -0,0 +1,139 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+
+#if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
+
+#include <fstream>
+#include <iostream>
+#include <boost/interprocess/xsi_shared_memory.hpp>
+#include <boost/interprocess/mapped_region.hpp>
+#include <boost/interprocess/file_mapping.hpp>
+#include <boost/interprocess/detail/file_wrapper.hpp>
+#include <string>
+#include <iostream>
+#include "get_process_id_name.hpp"
+
+using namespace boost::interprocess;
+
+void remove_shared_memory(const xsi_key &key)
+{
+ try{
+ xsi_shared_memory xsi(open_only, key);
+ xsi_shared_memory::remove(xsi.get_shmid());
+ }
+ catch(interprocess_exception &e){
+ if(e.get_error_code() != not_found_error)
+ throw;
+ }
+}
+
+class xsi_shared_memory_remover
+{
+ public:
+ xsi_shared_memory_remover(xsi_shared_memory &xsi_shm)
+ : xsi_shm_(xsi_shm)
+ {}
+
+ ~xsi_shared_memory_remover()
+ { xsi_shared_memory::remove(xsi_shm_.get_shmid()); }
+ private:
+ xsi_shared_memory & xsi_shm_;
+};
+
+inline std::string get_filename()
+{
+ std::string ret (detail::get_temporary_path());
+ ret += "/";
+ ret += test::get_process_id_name();
+ return ret;
+}
+
+int main (int argc, char *argv[])
+{
+ std::string filename(get_filename());
+ const char *names[2] = { filename.c_str(), 0 };
+
+ file_mapping::remove(names[0]);
+ { detail::file_wrapper(create_only, names[0], read_write); }
+ xsi_key key(names[0], 1);
+ file_mapping::remove(names[0]);
+ remove_shared_memory(key);
+
+ unsigned int i;
+ try{
+ for(i = 0; i < sizeof(names)/sizeof(names[0]); ++i)
+ {
+ const std::size_t FileSize = 99999*2;
+ //Create a file mapping
+ xsi_shared_memory mapping (create_only, names[i] ? key : xsi_key(), FileSize);
+ xsi_shared_memory_remover rem(mapping);
+ try{
+ {
+ //Partial mapping should fail fox XSI shared memory
+ bool thrown = false;
+ try{
+ mapped_region region2(mapping, read_write, FileSize/2, FileSize - FileSize/2, 0);
+ }
+ catch(...){
+ thrown = true;
+ }
+ if(thrown == false){
+ return 1;
+ }
+ //Create a mapped region
+ mapped_region region (mapping, read_write, 0, FileSize, 0);
+
+ //Fill two regions with a pattern
+ unsigned char *filler = static_cast<unsigned char*>(region.get_address());
+ for(std::size_t i = 0; i < FileSize; ++i){
+ *filler++ = static_cast<unsigned char>(i);
+ }
+ }
+
+ //Now check the pattern mapping a single read only mapped_region
+ {
+ //Create a single region, mapping all the file
+ mapped_region region (mapping, read_only);
+
+ //Check pattern
+ unsigned char *pattern = static_cast<unsigned char*>(region.get_address());
+ for(std::size_t i = 0; i < FileSize; ++i, ++pattern){
+ if(*pattern != static_cast<unsigned char>(i)){
+ return 1;
+ }
+ }
+ }
+ }
+ catch(std::exception &exc){
+ std::cout << "Unhandled exception: " << exc.what() << std::endl;
+ return 1;
+ }
+ }
+ }
+ catch(std::exception &exc){
+ std::cout << "Unhandled exception: " << exc.what() << std::endl;
+ return 1;
+ }
+ return 0;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif //BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
+
+#include <boost/interprocess/detail/config_end.hpp>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk