diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-04-11 18:19:17 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-04-11 19:20:07 (GMT) |
commit | 857e44c156a1dbefcb49bb5792c4384cebd8762a (patch) | |
tree | 11947fb81ad9c502627f1b2bb8f090fb8d53c107 /3rdParty/Boost/src/boost/smart_ptr/detail | |
parent | 77d4eb7588e113beaa03f3347523b26adefdeb06 (diff) | |
download | swift-contrib-857e44c156a1dbefcb49bb5792c4384cebd8762a.zip swift-contrib-857e44c156a1dbefcb49bb5792c4384cebd8762a.tar.bz2 |
Updated Boost to 1.42.
Diffstat (limited to '3rdParty/Boost/src/boost/smart_ptr/detail')
6 files changed, 29 insertions, 13 deletions
diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/lwm_pthreads.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/lwm_pthreads.hpp index fc20dbb..8eda518 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/lwm_pthreads.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/lwm_pthreads.hpp @@ -17,6 +17,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // +#include <boost/assert.hpp> #include <pthread.h> namespace boost @@ -42,15 +43,15 @@ public: // HPUX 10.20 / DCE has a nonstandard pthread_mutex_init #if defined(__hpux) && defined(_DECTHREADS_) - pthread_mutex_init(&m_, pthread_mutexattr_default); + BOOST_VERIFY( pthread_mutex_init( &m_, pthread_mutexattr_default ) == 0 ); #else - pthread_mutex_init(&m_, 0); + BOOST_VERIFY( pthread_mutex_init( &m_, 0 ) == 0 ); #endif } ~lightweight_mutex() { - pthread_mutex_destroy(&m_); + BOOST_VERIFY( pthread_mutex_destroy( &m_ ) == 0 ); } class scoped_lock; @@ -69,12 +70,12 @@ public: scoped_lock(lightweight_mutex & m): m_(m.m_) { - pthread_mutex_lock(&m_); + BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 ); } ~scoped_lock() { - pthread_mutex_unlock(&m_); + BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 ); } }; }; diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/quick_allocator.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/quick_allocator.hpp index 6d136f8..159bd5e 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/quick_allocator.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/quick_allocator.hpp @@ -74,8 +74,9 @@ template<unsigned size, unsigned align_> struct allocator_impl static lightweight_mutex & mutex() { - static lightweight_mutex m; - return m; + static freeblock< sizeof( lightweight_mutex ), boost::alignment_of< lightweight_mutex >::value > fbm; + static lightweight_mutex * pm = new( &fbm ) lightweight_mutex; + return *pm; } static lightweight_mutex * mutex_init; diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/shared_count.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/shared_count.hpp index b968bba..4943e37 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/shared_count.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/shared_count.hpp @@ -333,6 +333,20 @@ public: if(pi_ != 0) pi_->weak_add_ref(); } +// Move support + +#if defined( BOOST_HAS_RVALUE_REFS ) + + weak_count(weak_count && r): pi_(r.pi_) // nothrow +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + , id_(weak_count_id) +#endif + { + r.pi_ = 0; + } + +#endif + ~weak_count() // nothrow { if(pi_ != 0) pi_->weak_release(); diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_convertible.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_convertible.hpp index 7d9502d..b7f0ea8 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_convertible.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_convertible.hpp @@ -25,7 +25,7 @@ # define BOOST_SP_NO_SP_CONVERTIBLE #endif -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x610 ) +#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x620 ) # define BOOST_SP_NO_SP_CONVERTIBLE #endif @@ -45,7 +45,7 @@ template< class Y, class T > struct sp_convertible static yes f( T* ); static no f( ... ); - enum _vt { value = sizeof( f( (Y*)0 ) ) == sizeof(yes) }; + enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes) }; }; struct sp_empty diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp index 8af6f0a..21fa59d 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp @@ -30,9 +30,9 @@ namespace detail inline int32_t compare_and_swap( int32_t * dest_, int32_t compare_, int32_t swap_ ) { - __asm__ __volatile__( "cas %0, %2, %1" - : "+m" (*dest_), "+r" (swap_) - : "r" (compare_) + __asm__ __volatile__( "cas [%1], %2, %0" + : "+r" (swap_) + : "r" (dest_), "r" (compare_) : "memory" ); return swap_; diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_has_sync.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_has_sync.hpp index cb0282d..7fcd09e 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_has_sync.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_has_sync.hpp @@ -40,7 +40,7 @@ #undef BOOST_SP_HAS_SYNC #endif -#if defined( __INTEL_COMPILER ) && !defined( __ia64__ ) +#if defined( __INTEL_COMPILER ) && !defined( __ia64__ ) && ( __INTEL_COMPILER < 1100 ) #undef BOOST_SP_HAS_SYNC #endif |