|
Boost-Commit : |
From: igaztanaga_at_[hidden]
Date: 2007-08-25 15:05:18
Author: igaztanaga
Date: 2007-08-25 15:05:18 EDT (Sat, 25 Aug 2007)
New Revision: 38949
URL: http://svn.boost.org/trac/boost/changeset/38949
Log:
#1211: Interprocess tests hang when run in parallel
#1080 boost::interprocess win32 global file mapping issue
Text files modified:
trunk/libs/interprocess/test/allocator_v1.hpp | 55 ++++++++++++++++------------------------
trunk/libs/interprocess/test/allocexcept_test.cpp | 4 +-
2 files changed, 24 insertions(+), 35 deletions(-)
Modified: trunk/libs/interprocess/test/allocator_v1.hpp
==============================================================================
--- trunk/libs/interprocess/test/allocator_v1.hpp (original)
+++ trunk/libs/interprocess/test/allocator_v1.hpp 2007-08-25 15:05:18 EDT (Sat, 25 Aug 2007)
@@ -28,49 +28,38 @@
#include <cstddef>
#include <stdexcept>
-/*!\file
- Describes an allocator_v1 that allocates portions of fixed size
- memory buffer (shared memory, mapped file...)
-*/
+//!\file
+//!Describes an allocator_v1 that allocates portions of fixed size
+//!memory buffer (shared memory, mapped file...)
namespace boost {
namespace interprocess {
namespace test {
-/*!An STL compatible allocator_v1 that uses a segment manager as
- memory source. The internal pointer type will of the same type (raw, smart) as
- "typename SegmentManager::void_pointer" type. This allows
- placing the allocator_v1 in shared memory, memory mapped-files, etc...*/
+//!An STL compatible allocator_v1 that uses a segment manager as
+//!memory source. The internal pointer type will of the same type (raw, smart) as
+//!"typename SegmentManager::void_pointer" type. This allows
+//!placing the allocator_v1 in shared memory, memory mapped-files, etc...*/
template<class T, class SegmentManager>
class allocator_v1
{
private:
- /*!Self type*/
- typedef allocator_v1<T, SegmentManager> self_t;
-
- /*!Segment manager*/
- typedef SegmentManager segment_manager;
-
- /*!Pointer to void */
+ typedef allocator_v1<T, SegmentManager> self_t;
+ typedef SegmentManager segment_manager;
typedef typename segment_manager::void_pointer aux_pointer_t;
- /*!Typedef to const void pointer */
typedef typename
detail::pointer_to_other
<aux_pointer_t, const void>::type cvoid_ptr;
- /*!Pointer to the allocator_v1*/
typedef typename detail::pointer_to_other
<cvoid_ptr, segment_manager>::type alloc_ptr_t;
- /*!Not assignable from related allocator_v1*/
template<class T2, class SegmentManager2>
allocator_v1& operator=(const allocator_v1<T2, SegmentManager2>&);
- /*!Not assignable from other allocator_v1*/
allocator_v1& operator=(const allocator_v1&);
- /*!Pointer to the allocator_v1*/
alloc_ptr_t mp_mngr;
public:
@@ -86,14 +75,14 @@
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
- /*!Obtains an allocator_v1 of other type*/
+ //!Obtains an allocator_v1 of other type
template<class T2>
struct rebind
{
typedef allocator_v1<T2, SegmentManager> other;
};
- /*!Returns the segment manager. Never throws*/
+ //!Returns the segment manager. Never throws
segment_manager* get_segment_manager()const
{ return detail::get_pointer(mp_mngr); }
/*
@@ -105,25 +94,25 @@
const_pointer address(const_reference value) const
{ return const_pointer(addressof(value)); }
*/
- /*!Constructor from the segment manager. Never throws*/
+ //!Constructor from the segment manager. Never throws
allocator_v1(segment_manager *segment_mngr)
: mp_mngr(segment_mngr) { }
- /*!Constructor from other allocator_v1. Never throws*/
+ //!Constructor from other allocator_v1. Never throws
allocator_v1(const allocator_v1 &other)
: mp_mngr(other.get_segment_manager()){ }
- /*!Constructor from related allocator_v1. Never throws*/
+ //!Constructor from related allocator_v1. Never throws
template<class T2>
allocator_v1(const allocator_v1<T2, SegmentManager> &other)
: mp_mngr(other.get_segment_manager()){}
- /*!Allocates memory for an array of count elements.
- Throws boost::interprocess::bad_alloc if there is no enough memory*/
+ //!Allocates memory for an array of count elements.
+ //!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate(size_type count, cvoid_ptr hint = 0)
{ (void)hint; return pointer((value_type*)mp_mngr->allocate(count*sizeof(value_type))); }
- /*!Deallocates memory previously allocated. Never throws*/
+ //!Deallocates memory previously allocated. Never throws
void deallocate(const pointer &ptr, size_type)
{ mp_mngr->deallocate(detail::get_pointer(ptr)); }
/*
@@ -136,23 +125,23 @@
void destroy(const pointer &ptr)
{ BOOST_ASSERT(ptr != 0); (*ptr).~value_type(); }
*/
- /*!Returns the number of elements that could be allocated. Never throws*/
+ //!Returns the number of elements that could be allocated. Never throws
size_type max_size() const
{ return mp_mngr->get_size(); }
- /*!Swap segment manager. Does not throw. If each allocator_v1 is placed in
- different memory segments, the result is undefined.*/
+ //!Swap segment manager. Does not throw. If each allocator_v1 is placed in
+ //!different memory segments, the result is undefined.
friend void swap(self_t &alloc1, self_t &alloc2)
{ detail::do_swap(alloc1.mp_mngr, alloc2.mp_mngr); }
};
-/*!Equality test for same type of allocator_v1*/
+//!Equality test for same type of allocator_v1
template<class T, class SegmentManager> inline
bool operator==(const allocator_v1<T , SegmentManager> &alloc1,
const allocator_v1<T, SegmentManager> &alloc2)
{ return alloc1.get_segment_manager() == alloc2.get_segment_manager(); }
-/*!Inequality test for same type of allocator_v1*/
+//!Inequality test for same type of allocator_v1
template<class T, class SegmentManager> inline
bool operator!=(const allocator_v1<T, SegmentManager> &alloc1,
const allocator_v1<T, SegmentManager> &alloc2)
Modified: trunk/libs/interprocess/test/allocexcept_test.cpp
==============================================================================
--- trunk/libs/interprocess/test/allocexcept_test.cpp (original)
+++ trunk/libs/interprocess/test/allocexcept_test.cpp 2007-08-25 15:05:18 EDT (Sat, 25 Aug 2007)
@@ -18,7 +18,7 @@
#include <functional>
#include "print_container.hpp"
#include <string>
-#include "get_compiler_name.hpp"
+#include "get_process_id_name.hpp"
struct InstanceCounter
{
@@ -36,7 +36,7 @@
int main ()
{
const int memsize = 16384;
- const char *const shMemName = test::get_compiler_name();
+ const char *const shMemName = test::get_process_id_name();
try{
shared_memory_object::remove(shMemName);
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