diff --git a/include/boost/smart_ptr/detail/quick_allocator.hpp b/include/boost/smart_ptr/detail/quick_allocator.hpp index 6d136f8..159bd5e 100644 --- a/include/boost/smart_ptr/detail/quick_allocator.hpp +++ b/include/boost/smart_ptr/detail/quick_allocator.hpp @@ -74,8 +74,9 @@ template 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/include/boost/smart_ptr/intrusive_ptr.hpp b/include/boost/smart_ptr/intrusive_ptr.hpp index 0e30ece..e72eb21 100644 --- a/include/boost/smart_ptr/intrusive_ptr.hpp +++ b/include/boost/smart_ptr/intrusive_ptr.hpp @@ -77,7 +77,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - intrusive_ptr( intrusive_ptr const & rhs, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + intrusive_ptr( intrusive_ptr const & rhs, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else diff --git a/include/boost/smart_ptr/shared_ptr.hpp b/include/boost/smart_ptr/shared_ptr.hpp index 8256d00..609cce9 100644 --- a/include/boost/smart_ptr/shared_ptr.hpp +++ b/include/boost/smart_ptr/shared_ptr.hpp @@ -228,7 +228,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_ptr( shared_ptr const & r, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + shared_ptr( shared_ptr const & r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else @@ -353,7 +353,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_ptr( shared_ptr && r, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + shared_ptr( shared_ptr && r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else @@ -448,7 +448,7 @@ public: return pn < rhs.pn; } - void * _internal_get_deleter( detail::sp_typeinfo const & ti ) const + void * _internal_get_deleter( boost::detail::sp_typeinfo const & ti ) const { return pn.get_deleter( ti ); } diff --git a/include/boost/smart_ptr/weak_ptr.hpp b/include/boost/smart_ptr/weak_ptr.hpp index 8690cca..d314b0d 100644 --- a/include/boost/smart_ptr/weak_ptr.hpp +++ b/include/boost/smart_ptr/weak_ptr.hpp @@ -63,7 +63,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( weak_ptr const & r, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + weak_ptr( weak_ptr const & r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else @@ -79,7 +79,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( weak_ptr && r, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + weak_ptr( weak_ptr && r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else @@ -110,7 +110,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( shared_ptr const & r, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + weak_ptr( shared_ptr const & r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else diff --git a/test/sp_typeinfo_test.cpp b/test/sp_typeinfo_test.cpp index c47d04e..e29e576 100644 --- a/test/sp_typeinfo_test.cpp +++ b/test/sp_typeinfo_test.cpp @@ -28,7 +28,7 @@ int main() BOOST_TEST( !ti.before( ti ) ); char const * nti = ti.name(); - std::cout << nti << std::endl; + std::cout << nti << std::endl; boost::detail::sp_typeinfo const & tv = BOOST_SP_TYPEID( void ); @@ -40,7 +40,7 @@ int main() BOOST_TEST( !tv.before( tv ) ); char const * ntv = tv.name(); - std::cout << ntv << std::endl; + std::cout << ntv << std::endl; BOOST_TEST( ti != tv ); BOOST_TEST( !( ti == tv ) );