d067bd7293
The rope extension uses a volatile variable for its reference count. This is not only unnecessary for correctness (volatile provides neither atomicity nor memory visibility, and the variable is only modified while a lock is held) but it now causes deprecated warnings with -Wsystem-headers due to the use of ++ and -- operators. It would be possible to use __gnu_cxx::__exchange_and_add in _M_incr and _M_decr when __atomic_is_lock_free(sizeof(_RC_t), &_M_ref_count) is true, rather than locking a mutex. That would probably be a significant improvement for multi-threaded and single-threaded code (because __exchange_and_add will use non-atomic ops when possible, and even in MT code it should be faster than the mutex lock/unlock pair). However, mixing objects compiled with the old and new code would result in inconsistent synchronization being used for the reference count. libstdc++-v3/ChangeLog: * include/ext/rope (_Refcount_Base::_M_ref_count): Remove volatile qualifier. (_Refcount_Base::_M_decr()): Likewise. |
||
---|---|---|
.. | ||
pb_ds | ||
algorithm | ||
aligned_buffer.h | ||
alloc_traits.h | ||
atomicity.h | ||
bitmap_allocator.h | ||
cast.h | ||
cmath | ||
codecvt_specializations.h | ||
concurrence.h | ||
debug_allocator.h | ||
enc_filebuf.h | ||
extptr_allocator.h | ||
functional | ||
iterator | ||
malloc_allocator.h | ||
memory | ||
mt_allocator.h | ||
new_allocator.h | ||
numeric | ||
numeric_traits.h | ||
pod_char_traits.h | ||
pointer.h | ||
pool_allocator.h | ||
random | ||
random.tcc | ||
rb_tree | ||
rc_string_base.h | ||
rope | ||
ropeimpl.h | ||
slist | ||
sso_string_base.h | ||
stdio_filebuf.h | ||
stdio_sync_filebuf.h | ||
string_conversions.h | ||
throw_allocator.h | ||
type_traits.h | ||
typelist.h | ||
vstring_fwd.h | ||
vstring_util.h | ||
vstring.h | ||
vstring.tcc |