diff options
author | Chanho Park <chanho61.park@samsung.com> | 2014-12-11 18:55:56 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-12-11 18:55:56 +0900 |
commit | 08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch) | |
tree | 7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/interprocess/smart_ptr/detail | |
parent | bb4dd8289b351fae6b55e303f189127a394a1edd (diff) | |
download | boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2 boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip |
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/interprocess/smart_ptr/detail')
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 9429613492..77ceda0c58 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 7daaee6ea4..aed83eb2ab 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 24d96ee482..47743c1b91 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 edb39eeeb3..6ec1d56e59 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 6a46bb75e6..3e01be5531 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(); } |