1 #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED 2 #define BOOST_SMART_PTR_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED 6 #if defined(_MSC_VER) && (_MSC_VER >= 1020) 23 #if defined(BOOST_SP_USE_STD_ALLOCATOR) && defined(BOOST_SP_USE_QUICK_ALLOCATOR) 24 # error BOOST_SP_USE_STD_ALLOCATOR and BOOST_SP_USE_QUICK_ALLOCATOR are incompatible. 30 #if defined(BOOST_SP_USE_QUICK_ALLOCATOR) 31 #include <boost/smart_ptr/detail/quick_allocator.hpp> 34 #if defined(BOOST_SP_USE_STD_ALLOCATOR) 43 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) 45 void sp_scalar_constructor_hook(
void * px, std::size_t size,
void * pn );
46 void sp_scalar_destructor_hook(
void * px, std::size_t size,
void * pn );
68 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) 69 boost::sp_scalar_constructor_hook( px,
sizeof(X),
this );
75 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) 76 boost::sp_scalar_destructor_hook( px_,
sizeof(X),
this );
91 #if defined(BOOST_SP_USE_STD_ALLOCATOR) 93 void *
operator new( std::size_t )
95 return std::allocator<this_type>().
allocate( 1, static_cast<this_type *>(0) );
98 void operator delete(
void * p )
100 std::allocator<this_type>().deallocate( static_cast<this_type *>(p), 1 );
105 #if defined(BOOST_SP_USE_QUICK_ALLOCATOR) 107 void *
operator new( std::size_t )
109 return quick_allocator<this_type>::alloc();
112 void operator delete(
void * p )
114 quick_allocator<this_type>::dealloc( p );
124 # pragma option push -Vx- 163 return &
reinterpret_cast<char&
>( del );
166 #if defined(BOOST_SP_USE_STD_ALLOCATOR) 168 void *
operator new( std::size_t )
170 return std::allocator<this_type>().
allocate( 1, static_cast<this_type *>(0) );
173 void operator delete(
void * p )
175 std::allocator<this_type>().deallocate( static_cast<this_type *>(p), 1 );
180 #if defined(BOOST_SP_USE_QUICK_ALLOCATOR) 182 void *
operator new( std::size_t )
184 return quick_allocator<this_type>::alloc();
187 void operator delete(
void * p )
189 quick_allocator<this_type>::dealloc( p );
227 typedef typename A::template rebind< this_type >::other A2;
232 a2.deallocate(
this, 1 );
242 return &
reinterpret_cast<char&
>( d_ );
254 #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED void checked_delete(T *x)
sp_counted_impl_pd(P p, D &d)
virtual void * get_untyped_deleter()
virtual void * get_deleter(detail::sp_typeinfo const &ti)
virtual void * get_untyped_deleter()
char * allocate(unsigned int n)
#define BOOST_SP_TYPEID(T)
virtual void * get_untyped_deleter()
sp_counted_impl_pda(P p, D &d, A a)
std::type_info sp_typeinfo
virtual void * get_deleter(detail::sp_typeinfo const &ti)
sp_counted_impl_pda(P p, A a)
virtual void * get_deleter(detail::sp_typeinfo const &)