Fixed C++0x and MacOS X bugs

[SVN r52416]
This commit is contained in:
Ion Gaztañaga
2009-04-16 07:05:08 +00:00
parent e9570883ac
commit 95861ad943
18 changed files with 299 additions and 8 deletions

View File

@@ -15,7 +15,9 @@
#include <cstring>//std::memset
#include <new> //std::nothrow
#include <vector> //std::vector
//<-
#include "../test/get_process_id_name.hpp"
//->
int main()
{
@@ -25,11 +27,28 @@ int main()
//Remove shared memory on construction and destruction
struct shm_remove
{
//<-
#if 1
shm_remove() { shared_memory_object::remove(test::get_process_id_name()); }
~shm_remove(){ shared_memory_object::remove(test::get_process_id_name()); }
#else
//->
shm_remove() { shared_memory_object::remove("MySharedMemory"); }
~shm_remove(){ shared_memory_object::remove("MySharedMemory"); }
//<-
#endif
//->
} remover;
managed_shared_memory managed_shm(create_only, "MySharedMemory", 65536);
//<-
#if 1
managed_shared_memory managed_shm(create_only,test::get_process_id_name(), 65536);
#else
//->
managed_shared_memory managed_shm(create_only,"MySharedMemory", 65536);
//<-
#endif
//->
//Allocate 16 elements of 100 bytes in a single call. Non-throwing version.
multiallocation_chain chain(managed_shm.allocate_many(100, 16, std::nothrow));