mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-19 16:22:19 +00:00
Updated copyright end year
[SVN r80133]
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012. 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)
|
||||
//
|
||||
@@ -48,7 +48,7 @@ bool test_types_and_convertions()
|
||||
pcint_t pcint(0);
|
||||
pvint_t pvint(0);
|
||||
pcvint_t pcvint(0);
|
||||
|
||||
|
||||
pint = &dummy_int;
|
||||
pcint = &dummy_int;
|
||||
pvint = &dummy_int;
|
||||
@@ -75,7 +75,7 @@ bool test_arithmetic()
|
||||
typedef intersegment_ptr<int> pint_t;
|
||||
const int NumValues = 5;
|
||||
int values[NumValues];
|
||||
|
||||
|
||||
//Initialize p
|
||||
pint_t p = values;
|
||||
if(p.get() != values)
|
||||
@@ -376,7 +376,7 @@ bool test_multi_segment_shared_memory()
|
||||
shared_memory_object::remove("kk0");
|
||||
managed_multi_shared_memory mshm(create_only, "kk", 4096);
|
||||
}
|
||||
|
||||
|
||||
shared_memory_object::remove("kk0");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Peter Dimov 2002-2005.
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
@@ -219,7 +219,7 @@ int list_test (bool copied_allocators_equal = true)
|
||||
shmlist->splice(shmlist->begin(), othershmlist);
|
||||
stdlist->splice(stdlist->begin(), otherstdlist);
|
||||
if(!CheckEqualContainers(shmlist, stdlist))
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
listsize = (int)shmlist->size();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -83,7 +83,7 @@ int main ()
|
||||
|
||||
//Construct a vector in the memory-mapped file
|
||||
mfile_vect = mfile.construct<MyVect> ("MyVector") (myallocator);
|
||||
|
||||
|
||||
//Flush cached data from memory-mapped file to disk
|
||||
mfile.flush();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -123,7 +123,7 @@ int main ()
|
||||
if(!shmem_vect)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//Destroy and check it is not present
|
||||
w_shm_new.destroy_ptr(w_shm_vect);
|
||||
if(0 != w_shm_new.find<MyVect>("MyVector").first)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2008-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2008-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
@@ -67,7 +67,7 @@ int map_test ()
|
||||
|
||||
MyStdMultiMap *stdmultimap = new MyStdMultiMap;
|
||||
|
||||
//Test construction from a range
|
||||
//Test construction from a range
|
||||
{
|
||||
//This is really nasty, but we have no other simple choice
|
||||
IntPairType aux_vect[50];
|
||||
@@ -555,7 +555,7 @@ int map_test_copyable ()
|
||||
stdmapcopy = *stdmap;
|
||||
shmmmapcopy = *shmmultimap;
|
||||
stdmmapcopy = *stdmultimap;
|
||||
|
||||
|
||||
if(!CheckEqualContainers(&shmmapcopy, &stdmapcopy))
|
||||
return 1;
|
||||
if(!CheckEqualContainers(&shmmmapcopy, &stdmmapcopy))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -37,7 +37,7 @@ struct file_destroyer
|
||||
~file_destroyer()
|
||||
{
|
||||
//The last destructor will destroy the file
|
||||
file_mapping::remove(get_filename().c_str());
|
||||
file_mapping::remove(get_filename().c_str());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -72,7 +72,7 @@ int main ()
|
||||
test::test_named_creation<mapped_file_creation_test_wrapper>();
|
||||
|
||||
//Create and get name, size and address
|
||||
{
|
||||
{
|
||||
mapped_file file1(create_only, get_filename().c_str(), FileSize, read_write, 0, permissions());
|
||||
|
||||
//Overwrite all memory
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
@@ -118,7 +118,7 @@ bool test_allocation_shrink(Allocator &a)
|
||||
std::memset(buffers[i], 0, a.size(buffers[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Deallocate it in non sequential order
|
||||
for(int j = 0, max = (int)buffers.size()
|
||||
;j < max
|
||||
@@ -170,7 +170,7 @@ bool test_allocation_expand(Allocator &a)
|
||||
preferred_size = min_size*2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Deallocate it in non sequential order
|
||||
for(int j = 0, max = (int)buffers.size()
|
||||
;j < max
|
||||
@@ -243,7 +243,7 @@ bool test_allocation_shrink_and_expand(Allocator &a)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Deallocate it in non sequential order
|
||||
for(int j = 0, max = (int)buffers.size()
|
||||
;j < max
|
||||
@@ -310,7 +310,7 @@ bool test_allocation_deallocation_expand(Allocator &a)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Now erase null values from the vector
|
||||
buffers.erase( std::remove(buffers.begin(), buffers.end(), static_cast<void*>(0))
|
||||
, buffers.end());
|
||||
@@ -349,7 +349,7 @@ bool test_allocation_with_reuse(Allocator &a)
|
||||
std::memset(ptr, 0, size);
|
||||
buffers.push_back(ptr);
|
||||
}
|
||||
|
||||
|
||||
//Now deallocate all except the latest
|
||||
//Now try to expand to the double of the sizeof_object
|
||||
for(int i = 0, max = (int)buffers.size() - 1
|
||||
@@ -381,7 +381,7 @@ bool test_allocation_with_reuse(Allocator &a)
|
||||
}
|
||||
//There is only a single block so deallocate it
|
||||
a.deallocate(ptr);
|
||||
|
||||
|
||||
if(!a.all_memory_deallocated() || !a.check_sanity())
|
||||
return false;
|
||||
}
|
||||
@@ -405,7 +405,7 @@ bool test_aligned_allocation(Allocator &a)
|
||||
continue_loop = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(((std::size_t)ptr & (j - 1)) != 0)
|
||||
return false;
|
||||
a.deallocate(ptr);
|
||||
@@ -441,7 +441,7 @@ bool test_continuous_aligned_allocation(Allocator &a)
|
||||
else{
|
||||
any_allocated = true;
|
||||
}
|
||||
|
||||
|
||||
if(((std::size_t)ptr & (j - 1)) != 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
@@ -93,7 +93,7 @@ class movable_and_copyable_int
|
||||
movable_and_copyable_int(const movable_and_copyable_int& mmi)
|
||||
: m_int(mmi.m_int)
|
||||
{}
|
||||
|
||||
|
||||
movable_and_copyable_int &operator= (BOOST_COPY_ASSIGN_REF(movable_and_copyable_int) mi)
|
||||
{ this->m_int = mi.m_int; return *this; }
|
||||
|
||||
@@ -155,7 +155,7 @@ class copyable_int
|
||||
copyable_int(const copyable_int& mmi)
|
||||
: m_int(mmi.m_int)
|
||||
{}
|
||||
|
||||
|
||||
copyable_int & operator= (const copyable_int &mi)
|
||||
{ this->m_int = mi.m_int; return *this; }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -232,7 +232,7 @@ template<typename M>
|
||||
void test_mutex_lock()
|
||||
{
|
||||
shared_val = 0;
|
||||
|
||||
|
||||
M mtx;
|
||||
|
||||
data<M> d1(1);
|
||||
@@ -260,7 +260,7 @@ template<typename M>
|
||||
void test_mutex_lock_timeout()
|
||||
{
|
||||
shared_val = 0;
|
||||
|
||||
|
||||
M mtx;
|
||||
|
||||
int wait_time_s = BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS / 1000;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -25,7 +25,7 @@ struct condition_deleter
|
||||
std::string name;
|
||||
|
||||
~condition_deleter()
|
||||
{
|
||||
{
|
||||
if(name.empty())
|
||||
named_condition::remove(test::add_to_process_id_name("named_condition"));
|
||||
else
|
||||
@@ -167,7 +167,7 @@ struct mutex_deleter
|
||||
std::string name;
|
||||
|
||||
~mutex_deleter()
|
||||
{
|
||||
{
|
||||
if(name.empty())
|
||||
named_mutex::remove(test::add_to_process_id_name("named_mutex"));
|
||||
else
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2008-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2008-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -23,7 +23,7 @@ namespace boost { namespace interprocess { namespace test {
|
||||
|
||||
template <class NamedResource>
|
||||
inline void create_then_open_then_open_or_create()
|
||||
{
|
||||
{
|
||||
try{
|
||||
//Create it and open it twice
|
||||
NamedResource nresource1(create_only);
|
||||
@@ -38,7 +38,7 @@ inline void create_then_open_then_open_or_create()
|
||||
|
||||
template <class NamedResource>
|
||||
inline void open_or_create_then_create()
|
||||
{
|
||||
{
|
||||
//Create it with open_or_create and try to create it twice
|
||||
NamedResource nresource1(open_or_create);
|
||||
try{
|
||||
@@ -51,7 +51,7 @@ inline void open_or_create_then_create()
|
||||
|
||||
template <class NamedResource>
|
||||
inline void dont_create_and_open()
|
||||
{
|
||||
{
|
||||
//Try to open it without creating
|
||||
try{
|
||||
NamedResource nresource1(open_only);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012. 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)
|
||||
//
|
||||
@@ -49,7 +49,7 @@ bool test_node_pool<NodePool>::allocate_then_deallocate(NodePool &pool)
|
||||
if((pool.get_real_num_node() - 1) != pool.num_free_nodes()){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//Now deallocate all and check again
|
||||
for(std::size_t i = 0; i < num_alloc; ++i){
|
||||
pool.deallocate_node(nodes[i]);
|
||||
@@ -59,7 +59,7 @@ bool test_node_pool<NodePool>::allocate_then_deallocate(NodePool &pool)
|
||||
if(4*pool.get_real_num_node() != pool.num_free_nodes()){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
pool.deallocate_free_blocks();
|
||||
|
||||
if(0 != pool.num_free_nodes()){
|
||||
@@ -92,7 +92,7 @@ bool test_node_pool<NodePool>::deallocate_free_blocks(NodePool &pool)
|
||||
if(0 != pool.num_free_nodes()){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//Now deallocate one of each block per iteration
|
||||
for(std::size_t node_i = 0; node_i < nodes_per_block; ++node_i){
|
||||
//Deallocate a node per block
|
||||
@@ -104,7 +104,7 @@ bool test_node_pool<NodePool>::deallocate_free_blocks(NodePool &pool)
|
||||
if(max_blocks*(node_i+1) != pool.num_free_nodes()){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//Now try to deallocate free blocks
|
||||
pool.deallocate_free_blocks();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2005-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012. 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)
|
||||
//
|
||||
@@ -60,7 +60,7 @@ bool test_types_and_conversions()
|
||||
pcint_t pcint(0);
|
||||
pvint_t pvint(0);
|
||||
pcvint_t pcvint(0);
|
||||
|
||||
|
||||
pint = &dummy_int;
|
||||
pcint = &dummy_int;
|
||||
pvint = &dummy_int;
|
||||
@@ -153,7 +153,7 @@ bool test_arithmetic()
|
||||
typedef offset_ptr<int> pint_t;
|
||||
const int NumValues = 5;
|
||||
int values[NumValues];
|
||||
|
||||
|
||||
//Initialize p
|
||||
pint_t p = values;
|
||||
if(p.get() != values)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -49,7 +49,7 @@ void PrintContainers(MyShmCont *shmcont, MyStdCont *stdcont)
|
||||
std::cout << *itshm << std::endl;
|
||||
}
|
||||
std::cout << "MyStdCont" << std::endl;
|
||||
|
||||
|
||||
for(; itstd != itstdend; ++itstd){
|
||||
std::cout << *itstd << std::endl;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2010-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2010-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2010-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2010-2012. 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)
|
||||
//
|
||||
@@ -69,7 +69,7 @@ int robust_mutex_test(int argc, char *argv[])
|
||||
while(!*go_ahead){
|
||||
ipcdetail::thread_yield();
|
||||
}
|
||||
|
||||
|
||||
std::cout << "... recovering mutex[0]" << std::endl;
|
||||
//First try to recover lock[0], put into consistent
|
||||
//state and relock it again
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2010-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2010-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -58,7 +58,7 @@ int set_test ()
|
||||
|
||||
MyStdMultiSet *stdmultiset = new MyStdMultiSet;
|
||||
|
||||
//Test construction from a range
|
||||
//Test construction from a range
|
||||
{
|
||||
IntType aux_vect[50];
|
||||
for(int i = 0; i < 50; ++i){
|
||||
@@ -567,7 +567,7 @@ int set_test_copyable ()
|
||||
|
||||
shmmsetcopy = *shmmultiset;
|
||||
stdmsetcopy = *stdmultiset;
|
||||
|
||||
|
||||
if(!CheckEqualContainers(&shmmsetcopy, &stdmsetcopy))
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2005-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -62,7 +62,7 @@ int main ()
|
||||
test::test_named_creation<shared_memory_creation_test_wrapper>();
|
||||
|
||||
//Create and get name, size and address
|
||||
{
|
||||
{
|
||||
shared_memory_object::remove(ShmName);
|
||||
shared_memory shm1(create_only, ShmName, ShmSize, read_write, 0, permissions());
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Peter Dimov 2002-2005, 2007.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2011.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
// 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)
|
||||
@@ -144,7 +144,7 @@ int string_shared_ptr_vector_insertion_test()
|
||||
{
|
||||
managed_shared_memory shmem(create_only, process_name.c_str(), 20000);
|
||||
|
||||
{
|
||||
{
|
||||
const int NumElements = 100;
|
||||
//Construct the allocator of strings
|
||||
string_allocator_t string_allocator(shmem.get_segment_manager());
|
||||
@@ -202,7 +202,7 @@ int string_shared_ptr_vector_insertion_test()
|
||||
}
|
||||
//Now fill a vector of weak_ptr-s
|
||||
string_weak_ptr_vector_t my_weakptr_vector(string_weak_ptr_allocator);
|
||||
my_weakptr_vector.insert(my_weakptr_vector.begin(), NumElements, string_weak_ptr);
|
||||
my_weakptr_vector.insert(my_weakptr_vector.begin(), NumElements, string_weak_ptr);
|
||||
//The shared count should remain the same
|
||||
if(string_shared_ptr.use_count() != static_cast<long>(my_sharedptr_vector.size()+1)){
|
||||
return 1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -82,7 +82,7 @@ int string_test()
|
||||
(create_only,
|
||||
process_name.c_str(),//segment name
|
||||
65536); //segment size in bytes
|
||||
|
||||
|
||||
ShmemAllocatorChar shmallocator (segment.get_segment_manager());
|
||||
|
||||
//Initialize vector with a range or iterators and allocator
|
||||
@@ -166,16 +166,16 @@ int string_test()
|
||||
shm_swapper.swap(auxShmString);
|
||||
std_swapper.swap(auxStdString);
|
||||
if(!StringEqual()(auxShmString, auxStdString))
|
||||
return 1;
|
||||
return 1;
|
||||
if(!StringEqual()(shm_swapper, std_swapper))
|
||||
return 1;
|
||||
return 1;
|
||||
|
||||
shm_swapper.swap(auxShmString);
|
||||
std_swapper.swap(auxStdString);
|
||||
if(!StringEqual()(auxShmString, auxStdString))
|
||||
return 1;
|
||||
return 1;
|
||||
if(!StringEqual()(shm_swapper, std_swapper))
|
||||
return 1;
|
||||
return 1;
|
||||
|
||||
auxShmString = "LongLongLongLongLongLongLongLongLongLongLongLongLongString";
|
||||
auxStdString = "LongLongLongLongLongLongLongLongLongLongLongLongLongString";
|
||||
@@ -184,16 +184,16 @@ int string_test()
|
||||
shm_swapper.swap(auxShmString);
|
||||
std_swapper.swap(auxStdString);
|
||||
if(!StringEqual()(auxShmString, auxStdString))
|
||||
return 1;
|
||||
return 1;
|
||||
if(!StringEqual()(shm_swapper, std_swapper))
|
||||
return 1;
|
||||
return 1;
|
||||
|
||||
shm_swapper.swap(auxShmString);
|
||||
std_swapper.swap(auxStdString);
|
||||
if(!StringEqual()(auxShmString, auxStdString))
|
||||
return 1;
|
||||
return 1;
|
||||
if(!StringEqual()(shm_swapper, std_swapper))
|
||||
return 1;
|
||||
return 1;
|
||||
|
||||
//No sort
|
||||
std::sort(shmStringVect->begin(), shmStringVect->end());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -42,19 +42,19 @@ typedef basic_managed_shared_memory
|
||||
|
||||
//We will work with narrow characters for shared memory objects
|
||||
//Alias an integer node allocator type
|
||||
typedef allocator<int, my_managed_shared_memory::segment_manager>
|
||||
typedef allocator<int, my_managed_shared_memory::segment_manager>
|
||||
shmem_allocator_t;
|
||||
typedef allocator<std::pair<const int, int>, my_managed_shared_memory::segment_manager>
|
||||
typedef allocator<std::pair<const int, int>, my_managed_shared_memory::segment_manager>
|
||||
shmem_node_pair_allocator_t;
|
||||
typedef allocator<test::movable_int, my_managed_shared_memory::segment_manager>
|
||||
typedef allocator<test::movable_int, my_managed_shared_memory::segment_manager>
|
||||
shmem_movable_allocator_t;
|
||||
typedef allocator<std::pair<const test::movable_int, test::movable_int>, my_managed_shared_memory::segment_manager>
|
||||
typedef allocator<std::pair<const test::movable_int, test::movable_int>, my_managed_shared_memory::segment_manager>
|
||||
shmem_movable_node_pair_allocator_t;
|
||||
typedef allocator<test::movable_and_copyable_int, my_managed_shared_memory::segment_manager>
|
||||
typedef allocator<test::movable_and_copyable_int, my_managed_shared_memory::segment_manager>
|
||||
shmem_move_copy_allocator_t;
|
||||
typedef allocator<test::copyable_int, my_managed_shared_memory::segment_manager>
|
||||
typedef allocator<test::copyable_int, my_managed_shared_memory::segment_manager>
|
||||
shmem_copy_allocator_t;
|
||||
typedef allocator<std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>, my_managed_shared_memory::segment_manager>
|
||||
typedef allocator<std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>, my_managed_shared_memory::segment_manager>
|
||||
shmem_move_copy_node_pair_allocator_t;
|
||||
|
||||
//Alias standard types
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
@@ -56,7 +56,7 @@ int main()
|
||||
shared_memory_object::remove(process_name.c_str());
|
||||
{
|
||||
managed_shared_memory segment(create_only, process_name.c_str(), 10000);
|
||||
|
||||
|
||||
//Create unique_ptr using dynamic allocation
|
||||
my_unique_ptr_class my_ptr (segment.construct<MyClass>(anonymous_instance)()
|
||||
,segment.get_deleter<MyClass>());
|
||||
@@ -83,7 +83,7 @@ int main()
|
||||
assert(my_ptr2.get() == 0);
|
||||
assert(list.begin()->get() == ptr1);
|
||||
assert(list.rbegin()->get() == ptr2);
|
||||
|
||||
|
||||
//Construct a set and fill
|
||||
typedef std::less<my_unique_ptr_class> set_less_t;
|
||||
MySet set(set_less_t(), segment.get_segment_manager());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -201,7 +201,7 @@ int main ()
|
||||
heaplist->merge(otherheaplist, std::greater<int>());
|
||||
stdlist->merge(otherstdlist, std::greater<int>());
|
||||
if(!CheckEqual(userlist, stdlist, heaplist)) return 1;
|
||||
|
||||
|
||||
user_buffer.destroy<MyUserList>(L"MyUserList");
|
||||
delete stdlist;
|
||||
|
||||
@@ -212,7 +212,7 @@ int main ()
|
||||
}
|
||||
}
|
||||
catch(boost::interprocess::bad_alloc &){}
|
||||
|
||||
|
||||
MyHeapList::size_type heap_list_size = heaplist->size();
|
||||
|
||||
//Copy heap buffer to another
|
||||
@@ -246,7 +246,7 @@ int main ()
|
||||
}
|
||||
catch(boost::interprocess::bad_alloc &){}
|
||||
|
||||
MyUserList::size_type user_list_size = userlist->size();
|
||||
MyUserList::size_type user_list_size = userlist->size();
|
||||
|
||||
if(user_list_size <= heap_list_size){
|
||||
return 1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -102,15 +102,15 @@ int vector_test()
|
||||
|
||||
shmvector->resize(100);
|
||||
stdvector->resize(100);
|
||||
if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
|
||||
if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
|
||||
|
||||
shmvector->resize(200);
|
||||
stdvector->resize(200);
|
||||
if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
|
||||
if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
|
||||
|
||||
shmvector->resize(0);
|
||||
stdvector->resize(0);
|
||||
if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
|
||||
if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
|
||||
|
||||
for(int i = 0; i < max; ++i){
|
||||
IntType new_int(i);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012. 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)
|
||||
//
|
||||
@@ -37,7 +37,7 @@ using namespace boost::interprocess;
|
||||
|
||||
static int vectorstream_test()
|
||||
{
|
||||
{ //Test high watermarking initialization
|
||||
{ //Test high watermarking initialization
|
||||
my_stringstream_t my_stringstream;
|
||||
int a (0);
|
||||
my_stringstream << 11;
|
||||
@@ -45,7 +45,7 @@ static int vectorstream_test()
|
||||
if(a != 11)
|
||||
return 1;
|
||||
}
|
||||
{ //Test high watermarking initialization
|
||||
{ //Test high watermarking initialization
|
||||
my_vectorstream_t my_stringstream;
|
||||
int a (0);
|
||||
my_stringstream << 13;
|
||||
@@ -66,7 +66,7 @@ static int vectorstream_test()
|
||||
my_stringstream << "testline: " << i << std::endl;
|
||||
std_stringstream << "testline: " << i << std::endl;
|
||||
}
|
||||
|
||||
|
||||
if(std::strcmp(my_stringstream.vector().c_str(), std_stringstream.str().c_str()) != 0){
|
||||
return 1;
|
||||
}
|
||||
@@ -75,10 +75,10 @@ static int vectorstream_test()
|
||||
my_stringstream >> str1 >> number1;
|
||||
std_stringstream >> str2 >> number2;
|
||||
if((str1 != str2) || (str1 != str3)){
|
||||
assert(0); return 1;
|
||||
assert(0); return 1;
|
||||
}
|
||||
if((number1 != number2) || (number1 != i)){
|
||||
assert(0); return 1;
|
||||
assert(0); return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,10 +105,10 @@ static int vectorstream_test()
|
||||
my_vectorstream >> str1 >> number1;
|
||||
std_stringstream >> str2 >> number2;
|
||||
if((str1 != str2) || (str1 != str3)){
|
||||
assert(0); return 1;
|
||||
assert(0); return 1;
|
||||
}
|
||||
if((number1 != number2) || (number1 != i)){
|
||||
assert(0); return 1;
|
||||
assert(0); return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,10 +131,10 @@ static int vectorstream_test()
|
||||
my_stringstream >> str1 >> number1;
|
||||
std_stringstream >> str2 >> number2;
|
||||
if((str1 != str2) || (str1 != str3)){
|
||||
assert(0); return 1;
|
||||
assert(0); return 1;
|
||||
}
|
||||
if((number1 != number2) || (number1 != i)){
|
||||
assert(0); return 1;
|
||||
assert(0); return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -48,7 +48,7 @@ int main ()
|
||||
,FileSize - FileSize/2
|
||||
,0);
|
||||
|
||||
//Fill two regions with a pattern
|
||||
//Fill two regions with a pattern
|
||||
unsigned char *filler = static_cast<unsigned char*>(region.get_address());
|
||||
for(std::size_t i = 0
|
||||
;i < FileSize/2
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2004-2012. 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)
|
||||
//
|
||||
@@ -93,7 +93,7 @@ int main (int argc, char *argv[])
|
||||
//Create a mapped region
|
||||
mapped_region region (mapping, read_write, 0, FileSize, 0);
|
||||
|
||||
//Fill two regions with a pattern
|
||||
//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);
|
||||
|
||||
Reference in New Issue
Block a user