Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48963 - in trunk/boost/serialization: . detail
From: ramey_at_[hidden]
Date: 2008-09-25 02:22:01


Author: ramey
Date: 2008-09-25 02:22:01 EDT (Thu, 25 Sep 2008)
New Revision: 48963
URL: http://svn.boost.org/trac/boost/changeset/48963

Log:
Fixed problems generated from unexpected sequence of static dtor calls
Fixed some minor TRAC items
Text files modified:
   trunk/boost/serialization/collection_traits.hpp | 2 +-
   trunk/boost/serialization/detail/shared_count_132.hpp | 4 ++--
   trunk/boost/serialization/singleton.hpp | 10 +++++++---
   3 files changed, 10 insertions(+), 6 deletions(-)

Modified: trunk/boost/serialization/collection_traits.hpp
==============================================================================
--- trunk/boost/serialization/collection_traits.hpp (original)
+++ trunk/boost/serialization/collection_traits.hpp 2008-09-25 02:22:01 EDT (Thu, 25 Sep 2008)
@@ -55,7 +55,7 @@
      #define BOOST_NO_INTRINSIC_INT64_T
 #else
     #if defined(ULONG_MAX)
- #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u) // 2**64 - 1
+ #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
             #define BOOST_NO_INTRINSIC_INT64_T
         #endif
     #else

Modified: trunk/boost/serialization/detail/shared_count_132.hpp
==============================================================================
--- trunk/boost/serialization/detail/shared_count_132.hpp (original)
+++ trunk/boost/serialization/detail/shared_count_132.hpp 2008-09-25 02:22:01 EDT (Thu, 25 Sep 2008)
@@ -292,12 +292,12 @@
 
     void * operator new(std::size_t)
     {
- return quick_allocator<this_type>::alloc();
+ return boost::detail::quick_allocator<this_type>::alloc();
     }
 
     void operator delete(void * p)
     {
- quick_allocator<this_type>::dealloc(p);
+ boost::detail::quick_allocator<this_type>::dealloc(p);
     }
 
 #endif

Modified: trunk/boost/serialization/singleton.hpp
==============================================================================
--- trunk/boost/serialization/singleton.hpp (original)
+++ trunk/boost/serialization/singleton.hpp 2008-09-25 02:22:01 EDT (Thu, 25 Sep 2008)
@@ -97,6 +97,7 @@
 class singleton : public singleton_module
 {
 private:
+ static bool m_is_destroyed;
     BOOST_DLLEXPORT static T & instance;
     // include this to provoke instantiation at pre-execution time
     static void use(T const &) {}
@@ -104,11 +105,11 @@
         static T t;
         // refer to instance, causing it to be instantiated (and
         // initialized at startup on working compilers)
+ assert(! m_is_destroyed);
         use(instance);
         return t;
     }
 public:
- static bool is_destroyed;
     BOOST_DLLEXPORT static T & get_mutable_instance(){
         assert(! is_locked());
         return get_instance();
@@ -116,8 +117,11 @@
     BOOST_DLLEXPORT static const T & get_const_instance(){
         return get_instance();
     }
+ BOOST_DLLEXPORT static bool is_destroyed(){
+ return m_is_destroyed;
+ }
     ~singleton(){
- is_destroyed = true;
+ m_is_destroyed = true;
     }
 };
 
@@ -125,7 +129,7 @@
 BOOST_DLLEXPORT T & singleton<T>::instance = singleton<T>::get_instance();
 
 template<class T>
-bool singleton<T>::is_destroyed = false;
+bool singleton<T>::m_is_destroyed = false;
 
 } // namespace serialization
 } // namespace boost


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