/usr/include/boost/smart_ptr/detail
NameSizeModeActions
atomic_count.hpp32320644editdlrm
atomic_count_gcc.hpp16230644editdlrm
atomic_count_gcc_atomic.hpp12770644editdlrm
atomic_count_gcc_x86.hpp17390644editdlrm
atomic_count_nt.hpp12000644editdlrm
atomic_count_pt.hpp20600644editdlrm
atomic_count_spin.hpp13060644editdlrm
atomic_count_std_atomic.hpp13490644editdlrm
atomic_count_sync.hpp14350644editdlrm
atomic_count_win32.hpp13540644editdlrm
lightweight_mutex.hpp12570644editdlrm
lightweight_thread.hpp34420644editdlrm
local_counted_base.hpp32170644editdlrm
local_sp_deleter.hpp17310644editdlrm
lwm_pthreads.hpp17530644editdlrm
lwm_std_mutex.hpp10770644editdlrm
lwm_win32_cs.hpp27960644editdlrm
operator_bool.hpp17310644editdlrm
quick_allocator.hpp51370644editdlrm
shared_count.hpp153670644editdlrm
spinlock.hpp18630644editdlrm
spinlock_gcc_arm.hpp27010644editdlrm
spinlock_gcc_atomic.hpp15190644editdlrm
spinlock_nt.hpp16260644editdlrm
spinlock_pool.hpp29540644editdlrm
spinlock_pt.hpp14740644editdlrm
spinlock_std_atomic.hpp17230644editdlrm
spinlock_sync.hpp16440644editdlrm
spinlock_w32.hpp21040644editdlrm
sp_convertible.hpp21570644editdlrm
sp_counted_base.hpp34800644editdlrm
sp_counted_base_acc_ia64.hpp34980644editdlrm
sp_counted_base_aix.hpp32700644editdlrm
sp_counted_base_cw_ppc.hpp34260644editdlrm
sp_counted_base_gcc_atomic.hpp33310644editdlrm
sp_counted_base_gcc_ia64.hpp40100644editdlrm
sp_counted_base_gcc_mips.hpp40970644editdlrm
sp_counted_base_gcc_ppc.hpp38770644editdlrm
sp_counted_base_gcc_sparc.hpp38500644editdlrm
sp_counted_base_gcc_x86.hpp39360644editdlrm
sp_counted_base_nt.hpp27330644editdlrm
sp_counted_base_pt.hpp37260644editdlrm
sp_counted_base_snc_ps3.hpp37760644editdlrm
sp_counted_base_spin.hpp30730644editdlrm
sp_counted_base_std_atomic.hpp35570644editdlrm
sp_counted_base_sync.hpp33260644editdlrm
sp_counted_base_vacpp_ppc.hpp36970644editdlrm
sp_counted_base_w32.hpp32640644editdlrm
sp_counted_impl.hpp68080644editdlrm
sp_disable_deprecated.hpp9830644editdlrm
sp_forward.hpp11800644editdlrm
sp_has_gcc_intrinsics.hpp7860644editdlrm
sp_has_sync_intrinsics.hpp18720644editdlrm
sp_interlocked.hpp65670644editdlrm
sp_noexcept.hpp11850644editdlrm
sp_nullptr_t.hpp9760644editdlrm
sp_obsolete.hpp9140644editdlrm
sp_thread_pause.hpp11010644editdlrm
sp_thread_sleep.hpp20160644editdlrm
sp_thread_yield.hpp18830644editdlrm
sp_typeinfo_.hpp11760644editdlrm
sp_win32_sleep.hpp11680644editdlrm
yield_k.hpp10910644editdlrm
Edit: /usr/include/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp (3498B)
#ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_ACC_IA64_HPP_INCLUDED #define BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_ACC_IA64_HPP_INCLUDED // // detail/sp_counted_base_acc_ia64.hpp - aC++ on HP-UX IA64 // // Copyright 2007 Baruch Zilber // Copyright 2007 Boris Gubenko // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // // Lock-free algorithm by Alexander Terekhov // #include #include #include #include #if defined(BOOST_SP_REPORT_IMPLEMENTATION) #include BOOST_PRAGMA_MESSAGE("Using HP aCC++/HP-UX/IA64 sp_counted_base") #endif BOOST_SP_OBSOLETE() namespace boost { namespace detail { inline void atomic_increment( int * pw ) { // ++*pw; _Asm_fetchadd(_FASZ_W, _SEM_REL, pw, +1, _LDHINT_NONE); } inline int atomic_decrement( int * pw ) { // return --*pw; int r = static_cast(_Asm_fetchadd(_FASZ_W, _SEM_REL, pw, -1, _LDHINT_NONE)); if (1 == r) { _Asm_mf(); } return r - 1; } inline int atomic_conditional_increment( int * pw ) { // if( *pw != 0 ) ++*pw; // return *pw; int v = *pw; for (;;) { if (0 == v) { return 0; } _Asm_mov_to_ar(_AREG_CCV, v, (_UP_CALL_FENCE | _UP_SYS_FENCE | _DOWN_CALL_FENCE | _DOWN_SYS_FENCE)); int r = static_cast(_Asm_cmpxchg(_SZ_W, _SEM_ACQ, pw, v + 1, _LDHINT_NONE)); if (r == v) { return r + 1; } v = r; } } class BOOST_SYMBOL_VISIBLE sp_counted_base { private: sp_counted_base( sp_counted_base const & ); sp_counted_base & operator= ( sp_counted_base const & ); int use_count_; // #shared int weak_count_; // #weak + (#shared != 0) public: sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) { } virtual ~sp_counted_base() // nothrow { } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. virtual void dispose() = 0; // nothrow // destroy() is called when weak_count_ drops to zero. virtual void destroy() // nothrow { delete this; } virtual void * get_deleter( sp_typeinfo_ const & ti ) = 0; virtual void * get_local_deleter( sp_typeinfo_ const & ti ) = 0; virtual void * get_untyped_deleter() = 0; void add_ref_copy() { atomic_increment( &use_count_ ); } bool add_ref_lock() // true on success { return atomic_conditional_increment( &use_count_ ) != 0; } void release() // nothrow { if( atomic_decrement( &use_count_ ) == 0 ) { dispose(); weak_release(); } } void weak_add_ref() // nothrow { atomic_increment( &weak_count_ ); } void weak_release() // nothrow { if( atomic_decrement( &weak_count_ ) == 0 ) { destroy(); } } long use_count() const // nothrow { return static_cast( use_count_ ); // TODO use ld.acq here } }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_ACC_IA64_HPP_INCLUDED