[Smart pointers] BOOST_SP_HAS_SYNC undefined on ARM
Hi, I've been looking at some traces of our Android app (which is mostly native and extensively uses boost) and was surprised to find it uses spinlocks around the reference count of boost::shared_ptr. So I've checked the boost sources and found boost/smart_ptr/detail/atomic_count.hpp choosing the implementation depending on platform and other #defines, of which BOOST_SP_HAS_SYNC sounded like it should be turned on (Google recommends using gcc __sync_* intrinsics on Android). But, boost/smart_ptr/detail/sp_has_sync.hpp requires either __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 (which the Google cross-compiler apparently doesn't have), or (for recent gcc) #define BOOST_SP_HAS_SYNC #if defined( __arm__ ) || defined( __armel__ ) #undef BOOST_SP_HAS_SYNC #endif Why not use the intrinsics on ARM? Are they broken? For all ARM variants, or just some (ideally some old ones - I cound ignore them then)? Or are the intrinsics' semantics incompatible with the way boost atomic count needs? Bye Vasek -- http://www.mangrove.cz/
participants (1)
-
Vaclav Barta