Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71407 - in sandbox/shifted_ptr/boost: . detail
From: phil_at_[hidden]
Date: 2011-04-21 18:18:14


Author: pbouchard
Date: 2011-04-21 18:18:13 EDT (Thu, 21 Apr 2011)
New Revision: 71407
URL: http://svn.boost.org/trac/boost/changeset/71407

Log:
* Run-time check of memory block about to be freed
Text files modified:
   sandbox/shifted_ptr/boost/detail/sh_owned_base_nt.hpp | 4 ++--
   sandbox/shifted_ptr/boost/shifted_ptr.hpp | 7 +++++++
   2 files changed, 9 insertions(+), 2 deletions(-)

Modified: sandbox/shifted_ptr/boost/detail/sh_owned_base_nt.hpp
==============================================================================
--- sandbox/shifted_ptr/boost/detail/sh_owned_base_nt.hpp (original)
+++ sandbox/shifted_ptr/boost/detail/sh_owned_base_nt.hpp 2011-04-21 18:18:13 EDT (Thu, 21 Apr 2011)
@@ -105,7 +105,7 @@
 };
 
 
-////struct pool : boost::pool<>
+//struct pool : boost::pool<>
 struct pool : malloc_pool
 {
         typedef std::list< numeric::interval<long>, fast_pool_allocator< numeric::interval<long> > > pool_lii; /**< Syntax helper. */
@@ -121,7 +121,7 @@
                 Initialization of a pool instance.
         */
         
-//// pool() : boost::pool<>(1)
+// pool() : boost::pool<>(1)
     pool()
     {
         plii_.reset(new pool_lii());

Modified: sandbox/shifted_ptr/boost/shifted_ptr.hpp
==============================================================================
--- sandbox/shifted_ptr/boost/shifted_ptr.hpp (original)
+++ sandbox/shifted_ptr/boost/shifted_ptr.hpp 2011-04-21 18:18:13 EDT (Thu, 21 Apr 2011)
@@ -359,6 +359,13 @@
 
         ~shifted_ptr()
         {
+ std::set<void *>::iterator i = owned_base::pool_.alloc.find(base::po_);
+
+ if (i == owned_base::pool_.alloc.end())
+ abort();
+ else
+ owned_base::pool_.alloc.erase(i);
+
             release(true);
         }
 


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