summaryrefslogtreecommitdiff
path: root/boost/interprocess/smart_ptr/detail
diff options
context:
space:
mode:
Diffstat (limited to 'boost/interprocess/smart_ptr/detail')
-rw-r--r--boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp4
-rw-r--r--boost/interprocess/smart_ptr/detail/shared_count.hpp7
-rw-r--r--boost/interprocess/smart_ptr/detail/sp_counted_base.hpp6
-rw-r--r--boost/interprocess/smart_ptr/detail/sp_counted_base_atomic.hpp4
-rw-r--r--boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp15
5 files changed, 21 insertions, 15 deletions
diff --git a/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp b/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp
index 9429613..77ceda0 100644
--- a/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp
+++ b/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp
@@ -13,7 +13,7 @@
#ifndef BOOST_INTERPROCESS_BAD_WEAK_PTR_HPP_INCLUDED
#define BOOST_INTERPROCESS_BAD_WEAK_PTR_HPP_INCLUDED
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -36,7 +36,7 @@ class bad_weak_ptr
{ return "boost::interprocess::bad_weak_ptr"; }
};
-} // namespace interprocess
+} // namespace interprocess
} // namespace boost
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/smart_ptr/detail/shared_count.hpp b/boost/interprocess/smart_ptr/detail/shared_count.hpp
index 7daaee6..aed83eb 100644
--- a/boost/interprocess/smart_ptr/detail/shared_count.hpp
+++ b/boost/interprocess/smart_ptr/detail/shared_count.hpp
@@ -4,7 +4,7 @@
//
// (C) Copyright Peter Dimov and Multi Media Ltd. 2001, 2002, 2003
// (C) Copyright Peter Dimov 2004-2005
-// (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)
//
@@ -16,7 +16,7 @@
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -116,7 +116,7 @@ class shared_count
}
~shared_count() // nothrow
- {
+ {
if(m_pi)
m_pi->release();
}
@@ -284,6 +284,7 @@ class weak_count
weak_count & operator= (weak_count const & r) // nothrow
{
+ m_px = r.m_px;
counted_impl_ptr tmp = r.m_pi;
if(tmp != 0) tmp->weak_add_ref();
if(m_pi != 0) m_pi->weak_release();
diff --git a/boost/interprocess/smart_ptr/detail/sp_counted_base.hpp b/boost/interprocess/smart_ptr/detail/sp_counted_base.hpp
index 24d96ee..47743c1 100644
--- a/boost/interprocess/smart_ptr/detail/sp_counted_base.hpp
+++ b/boost/interprocess/smart_ptr/detail/sp_counted_base.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2011.
+// (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
@@ -12,6 +12,10 @@
#ifndef BOOST_INTERPROCESS_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
#define BOOST_INTERPROCESS_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
# include <boost/interprocess/smart_ptr/detail/sp_counted_base_atomic.hpp>
#endif // #ifndef BOOST_INTERPROCESS_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
diff --git a/boost/interprocess/smart_ptr/detail/sp_counted_base_atomic.hpp b/boost/interprocess/smart_ptr/detail/sp_counted_base_atomic.hpp
index edb39ee..6ec1d56 100644
--- a/boost/interprocess/smart_ptr/detail/sp_counted_base_atomic.hpp
+++ b/boost/interprocess/smart_ptr/detail/sp_counted_base_atomic.hpp
@@ -3,13 +3,13 @@
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
// Copyright 2004-2005 Peter Dimov
-// Copyright 2007-2011 Ion Gaztanaga
+// Copyright 2007-2012 Ion Gaztanaga
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
diff --git a/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp b/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp
index 6a46bb7..3e01be5 100644
--- a/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp
+++ b/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp
@@ -3,7 +3,7 @@
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -63,7 +63,7 @@ struct scoped_ptr_dealloc_functor
{ if (ptr) priv_deallocate(ptr, alloc_version()); }
};
-
+
template<class A, class D>
class sp_counted_impl_pd
@@ -83,6 +83,8 @@ class sp_counted_impl_pd
portable_rebind_alloc
< const this_type >::type const_this_allocator;
typedef typename this_allocator::pointer this_pointer;
+ typedef typename boost::intrusive::
+ pointer_traits<this_pointer> this_pointer_traits;
sp_counted_impl_pd( sp_counted_impl_pd const & );
sp_counted_impl_pd & operator= ( sp_counted_impl_pd const & );
@@ -115,14 +117,13 @@ class sp_counted_impl_pd
void destroy() // nothrow
{
- //Self destruction, so get a copy of the allocator
- //(in the future we could move it)
- this_allocator a_copy(*this);
+ //Self destruction, so move the allocator
+ this_allocator a_copy(::boost::move(static_cast<this_allocator&>(*this)));
BOOST_ASSERT(a_copy == *this);
- this_pointer this_ptr (this);
+ this_pointer this_ptr(this_pointer_traits::pointer_to(*this));
//Do it now!
scoped_ptr< this_type, scoped_ptr_dealloc_functor<this_allocator> >
- deleter(this_ptr, a_copy);
+ deleter_ptr(this_ptr, a_copy);
typedef typename this_allocator::value_type value_type;
ipcdetail::to_raw_pointer(this_ptr)->~value_type();
}