|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r68072 - in branches/release/libs/interprocess: . doc example proj/vc7ide test
From: igaztanaga_at_[hidden]
Date: 2011-01-12 17:23:11
Author: igaztanaga
Date: 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
New Revision: 68072
URL: http://svn.boost.org/trac/boost/changeset/68072
Log:
Merge from trunk for 1.46
Added:
branches/release/libs/interprocess/Jamfile.v2
- copied unchanged from r68070, /trunk/libs/interprocess/Jamfile.v2
branches/release/libs/interprocess/example/doc_xsi_shared_memory.cpp
- copied unchanged from r68070, /trunk/libs/interprocess/example/doc_xsi_shared_memory.cpp
branches/release/libs/interprocess/proj/vc7ide/doc_xsi_shared_memory.vcproj
- copied unchanged from r68070, /trunk/libs/interprocess/proj/vc7ide/doc_xsi_shared_memory.vcproj
branches/release/libs/interprocess/proj/vc7ide/managed_xsi_shared_memory.vcproj
- copied unchanged from r68070, /trunk/libs/interprocess/proj/vc7ide/managed_xsi_shared_memory.vcproj
branches/release/libs/interprocess/proj/vc7ide/xsi_shared_memory_mapping_test.vcproj
- copied unchanged from r68070, /trunk/libs/interprocess/proj/vc7ide/xsi_shared_memory_mapping_test.vcproj
branches/release/libs/interprocess/test/managed_xsi_shared_memory_test.cpp
- copied unchanged from r68070, /trunk/libs/interprocess/test/managed_xsi_shared_memory_test.cpp
branches/release/libs/interprocess/test/xsi_shared_memory_mapping_test.cpp
- copied unchanged from r68070, /trunk/libs/interprocess/test/xsi_shared_memory_mapping_test.cpp
Properties modified:
branches/release/libs/interprocess/ (props changed)
Text files modified:
branches/release/libs/interprocess/doc/interprocess.qbk | 52 +++++++++++++
branches/release/libs/interprocess/example/doc_file_mapping.cpp | 60 +++++++--------
branches/release/libs/interprocess/example/doc_managed_copy_on_write.cpp | 40 ++++++++--
branches/release/libs/interprocess/example/doc_managed_mapped_file.cpp | 19 ++++
branches/release/libs/interprocess/example/doc_shared_ptr.cpp | 42 ++++------
branches/release/libs/interprocess/example/doc_unique_ptr.cpp | 42 ++++------
branches/release/libs/interprocess/example/doc_windows_shared_memory.cpp | 5
branches/release/libs/interprocess/proj/vc7ide/Interprocess.sln | 154 ++++++---------------------------------
branches/release/libs/interprocess/proj/vc7ide/interprocesslib.vcproj | 9 ++
branches/release/libs/interprocess/test/managed_mapped_file_test.cpp | 40 +++++----
branches/release/libs/interprocess/test/mapped_file_test.cpp | 5 -
branches/release/libs/interprocess/test/shared_memory_test.cpp | 5 -
12 files changed, 218 insertions(+), 255 deletions(-)
Modified: branches/release/libs/interprocess/doc/interprocess.qbk
==============================================================================
--- branches/release/libs/interprocess/doc/interprocess.qbk (original)
+++ branches/release/libs/interprocess/doc/interprocess.qbk 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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: branches/release/libs/interprocess/example/doc_file_mapping.cpp
==============================================================================
--- branches/release/libs/interprocess/example/doc_file_mapping.cpp (original)
+++ branches/release/libs/interprocess/example/doc_file_mapping.cpp 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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: branches/release/libs/interprocess/example/doc_managed_copy_on_write.cpp
==============================================================================
--- branches/release/libs/interprocess/example/doc_managed_copy_on_write.cpp (original)
+++ branches/release/libs/interprocess/example/doc_managed_copy_on_write.cpp 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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: branches/release/libs/interprocess/example/doc_managed_mapped_file.cpp
==============================================================================
--- branches/release/libs/interprocess/example/doc_managed_mapped_file.cpp (original)
+++ branches/release/libs/interprocess/example/doc_managed_mapped_file.cpp 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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: branches/release/libs/interprocess/example/doc_shared_ptr.cpp
==============================================================================
--- branches/release/libs/interprocess/example/doc_shared_ptr.cpp (original)
+++ branches/release/libs/interprocess/example/doc_shared_ptr.cpp 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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: branches/release/libs/interprocess/example/doc_unique_ptr.cpp
==============================================================================
--- branches/release/libs/interprocess/example/doc_unique_ptr.cpp (original)
+++ branches/release/libs/interprocess/example/doc_unique_ptr.cpp 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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: branches/release/libs/interprocess/example/doc_windows_shared_memory.cpp
==============================================================================
--- branches/release/libs/interprocess/example/doc_windows_shared_memory.cpp (original)
+++ branches/release/libs/interprocess/example/doc_windows_shared_memory.cpp 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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);
Modified: branches/release/libs/interprocess/proj/vc7ide/Interprocess.sln
==============================================================================
--- branches/release/libs/interprocess/proj/vc7ide/Interprocess.sln (original)
+++ branches/release/libs/interprocess/proj/vc7ide/Interprocess.sln 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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
Modified: branches/release/libs/interprocess/proj/vc7ide/interprocesslib.vcproj
==============================================================================
--- branches/release/libs/interprocess/proj/vc7ide/interprocesslib.vcproj (original)
+++ branches/release/libs/interprocess/proj/vc7ide/interprocesslib.vcproj 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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"
Modified: branches/release/libs/interprocess/test/managed_mapped_file_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/managed_mapped_file_test.cpp (original)
+++ branches/release/libs/interprocess/test/managed_mapped_file_test.cpp 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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;
}
Modified: branches/release/libs/interprocess/test/mapped_file_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/mapped_file_test.cpp (original)
+++ branches/release/libs/interprocess/test/mapped_file_test.cpp 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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: branches/release/libs/interprocess/test/shared_memory_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/shared_memory_test.cpp (original)
+++ branches/release/libs/interprocess/test/shared_memory_test.cpp 2011-01-12 17:23:09 EST (Wed, 12 Jan 2011)
@@ -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());
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