forked from boostorg/smart_ptr
BOOST_ENABLE_SP_DEBUG_HOOKS -> BOOST_SP_ENABLE_DEBUG_HOOKS
[SVN r17301]
This commit is contained in:
@@ -47,7 +47,7 @@ namespace boost
|
|||||||
|
|
||||||
// Debug hooks
|
// Debug hooks
|
||||||
|
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
|
|
||||||
void sp_scalar_constructor_hook(void * px, std::size_t size, void * pn);
|
void sp_scalar_constructor_hook(void * px, std::size_t size, void * pn);
|
||||||
void sp_array_constructor_hook(void * px);
|
void sp_array_constructor_hook(void * px);
|
||||||
@@ -192,7 +192,7 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
|
|
||||||
template<class T> void cbi_call_constructor_hook(sp_counted_base * pn, T * px, checked_deleter<T> const &, int)
|
template<class T> void cbi_call_constructor_hook(sp_counted_base * pn, T * px, checked_deleter<T> const &, int)
|
||||||
{
|
{
|
||||||
@@ -249,14 +249,14 @@ public:
|
|||||||
|
|
||||||
sp_counted_base_impl(P p, D d): ptr(p), del(d)
|
sp_counted_base_impl(P p, D d): ptr(p), del(d)
|
||||||
{
|
{
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
detail::cbi_call_constructor_hook(this, p, d, 0);
|
detail::cbi_call_constructor_hook(this, p, d, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void dispose() // nothrow
|
virtual void dispose() // nothrow
|
||||||
{
|
{
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
detail::cbi_call_destructor_hook(this, ptr, del, 0);
|
detail::cbi_call_destructor_hook(this, ptr, del, 0);
|
||||||
#endif
|
#endif
|
||||||
del(ptr);
|
del(ptr);
|
||||||
@@ -296,7 +296,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
|
|
||||||
int const shared_count_id = 0x2C35F101;
|
int const shared_count_id = 0x2C35F101;
|
||||||
int const weak_count_id = 0x298C38A4;
|
int const weak_count_id = 0x298C38A4;
|
||||||
@@ -311,7 +311,7 @@ private:
|
|||||||
|
|
||||||
sp_counted_base * pi_;
|
sp_counted_base * pi_;
|
||||||
|
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
int id_;
|
int id_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -320,14 +320,14 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
shared_count(): pi_(0) // nothrow
|
shared_count(): pi_(0) // nothrow
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
, id_(shared_count_id)
|
, id_(shared_count_id)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class P, class D> shared_count(P p, D d): pi_(0)
|
template<class P, class D> shared_count(P p, D d): pi_(0)
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
, id_(shared_count_id)
|
, id_(shared_count_id)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@@ -362,7 +362,7 @@ public:
|
|||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
explicit shared_count(std::auto_ptr<Y> & r): pi_(new sp_counted_base_impl< Y *, checked_deleter<Y> >(r.get(), checked_deleter<Y>()))
|
explicit shared_count(std::auto_ptr<Y> & r): pi_(new sp_counted_base_impl< Y *, checked_deleter<Y> >(r.get(), checked_deleter<Y>()))
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
, id_(shared_count_id)
|
, id_(shared_count_id)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@@ -374,13 +374,13 @@ public:
|
|||||||
~shared_count() // nothrow
|
~shared_count() // nothrow
|
||||||
{
|
{
|
||||||
if(pi_ != 0) pi_->release();
|
if(pi_ != 0) pi_->release();
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
id_ = 0;
|
id_ = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
shared_count(shared_count const & r): pi_(r.pi_) // nothrow
|
shared_count(shared_count const & r): pi_(r.pi_) // nothrow
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
, id_(shared_count_id)
|
, id_(shared_count_id)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@@ -443,7 +443,7 @@ private:
|
|||||||
|
|
||||||
sp_counted_base * pi_;
|
sp_counted_base * pi_;
|
||||||
|
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
int id_;
|
int id_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -452,14 +452,14 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
weak_count(): pi_(0) // nothrow
|
weak_count(): pi_(0) // nothrow
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
, id_(weak_count_id)
|
, id_(weak_count_id)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
weak_count(shared_count const & r): pi_(r.pi_) // nothrow
|
weak_count(shared_count const & r): pi_(r.pi_) // nothrow
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
, id_(shared_count_id)
|
, id_(shared_count_id)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@@ -467,7 +467,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
weak_count(weak_count const & r): pi_(r.pi_) // nothrow
|
weak_count(weak_count const & r): pi_(r.pi_) // nothrow
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
, id_(shared_count_id)
|
, id_(shared_count_id)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@@ -477,7 +477,7 @@ public:
|
|||||||
~weak_count() // nothrow
|
~weak_count() // nothrow
|
||||||
{
|
{
|
||||||
if(pi_ != 0) pi_->weak_release();
|
if(pi_ != 0) pi_->weak_release();
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
id_ = 0;
|
id_ = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -526,7 +526,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline shared_count::shared_count(weak_count const & r): pi_(r.pi_)
|
inline shared_count::shared_count(weak_count const & r): pi_(r.pi_)
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
, id_(shared_count_id)
|
, id_(shared_count_id)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@@ -22,7 +22,7 @@ namespace boost
|
|||||||
|
|
||||||
// Debug hooks
|
// Debug hooks
|
||||||
|
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
|
|
||||||
void sp_array_constructor_hook(void * p);
|
void sp_array_constructor_hook(void * p);
|
||||||
void sp_array_destructor_hook(void * p);
|
void sp_array_destructor_hook(void * p);
|
||||||
@@ -50,14 +50,14 @@ public:
|
|||||||
|
|
||||||
explicit scoped_array(T * p = 0) : ptr(p) // never throws
|
explicit scoped_array(T * p = 0) : ptr(p) // never throws
|
||||||
{
|
{
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
boost::sp_array_constructor_hook(ptr);
|
boost::sp_array_constructor_hook(ptr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
~scoped_array() // never throws
|
~scoped_array() // never throws
|
||||||
{
|
{
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
boost::sp_array_destructor_hook(ptr);
|
boost::sp_array_destructor_hook(ptr);
|
||||||
#endif
|
#endif
|
||||||
boost::checked_array_delete(ptr);
|
boost::checked_array_delete(ptr);
|
||||||
|
@@ -24,7 +24,7 @@ namespace boost
|
|||||||
|
|
||||||
// Debug hooks
|
// Debug hooks
|
||||||
|
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
|
|
||||||
void sp_scalar_constructor_hook(void * p);
|
void sp_scalar_constructor_hook(void * p);
|
||||||
void sp_scalar_destructor_hook(void * p);
|
void sp_scalar_destructor_hook(void * p);
|
||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
|
|
||||||
explicit scoped_ptr(T * p = 0): ptr(p) // never throws
|
explicit scoped_ptr(T * p = 0): ptr(p) // never throws
|
||||||
{
|
{
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
boost::sp_scalar_constructor_hook(ptr);
|
boost::sp_scalar_constructor_hook(ptr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
|
|
||||||
explicit scoped_ptr(std::auto_ptr<T> p): ptr(p.release()) // never throws
|
explicit scoped_ptr(std::auto_ptr<T> p): ptr(p.release()) // never throws
|
||||||
{
|
{
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
boost::sp_scalar_constructor_hook(ptr);
|
boost::sp_scalar_constructor_hook(ptr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
|
|
||||||
~scoped_ptr() // never throws
|
~scoped_ptr() // never throws
|
||||||
{
|
{
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
boost::sp_scalar_destructor_hook(ptr);
|
boost::sp_scalar_destructor_hook(ptr);
|
||||||
#endif
|
#endif
|
||||||
boost::checked_delete(ptr);
|
boost::checked_delete(ptr);
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
// warranty, and with no claim as to its suitability for any purpose.
|
// warranty, and with no claim as to its suitability for any purpose.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
@@ -266,4 +266,4 @@ void sp_array_destructor_hook(void *)
|
|||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#endif // defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#endif // defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
// warranty, and with no claim as to its suitability for any purpose.
|
// warranty, and with no claim as to its suitability for any purpose.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <new>
|
#include <new>
|
||||||
@@ -241,4 +241,4 @@ void operator delete[](void * p, nothrow_t const &) throw()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // defined(BOOST_ENABLE_SP_DEBUG_HOOKS)
|
#endif // defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
|
Reference in New Issue
Block a user