gcc/libstdc++-v3/include
Nathan C. Myers ca566e4c07 Avoid multi-processor bus contention on increment/decrement-and- test of the reference count in the empty-string object...
2003-06-13  Nathan C. Myers <ncm-nospam@cantrip.org>

	Avoid multi-processor bus contention on increment/decrement-and-
	test of the reference count in the empty-string object, by comparing
        addresses first, and never touching the reference count of the empty-
        string object.
	* include/bits/basic_string.h:
	(_S_empty_rep_storage): Move into basic_string<>::_Rep for use by its
	members.
	(_Rep::_S_empty_rep()): New accessor.
	(_Rep::_M_length, _Rep::_M_capacity, _Rep::_M_references): Move to
	a base class _Rep_base.
	(_Rep::_M_dispose, _Rep::_M_refcopy): Check for the empty string.
	(basic_string()): Change to use _M_refdata() in place of _M_refcopy(),
	since no longer must increment its refcount.
	* include/bits/basic_string.tcc:
	(_Rep::_M_destroy, _M_leak_hard): Check for the empty string and
        return immediately.  The former might be unnecessary.  The latter
        prevents begin() and end() from cloning it unnecessarily.
	(_S_construct(_InIterator, _InIterator, const _Alloc&,
	input_iterator_tag), _S_construct(_InIterator, _InIterator,
	const _Alloc&, forward_iterator_tag), _S_construct(size_type, _CharT,
	const _Alloc&)): Change to use _M_refdata() in place of _M_refcopy().
	(_M_mutate): Check for the empty string and treat it as shared.
        This is necessary here because _M_mutate is sometimes called with
        all-zero arguments; in all other uses of _M_is_shared, the test comes
        out right anyhow.

From-SVN: r67912
2003-06-13 20:59:42 +00:00
..
backward [multiple changes] 2003-06-11 15:52:11 +00:00
bits Avoid multi-processor bus contention on increment/decrement-and- test of the reference count in the empty-string object... 2003-06-13 20:59:42 +00:00
c
c_compatibility
c_std re PR libstdc++/3181 (Unable to use sqrt,cos,sin,... with int argument.) 2003-05-11 09:07:17 +00:00
ext allocator-inst.cc: Explicitly instantiate. 2003-06-13 05:45:57 +00:00
std [multiple changes] 2003-06-11 15:52:11 +00:00
Makefile.am [multiple changes] 2003-06-11 15:52:11 +00:00
Makefile.in acinclude.m4 (GLIBCPP_ENABLE_CSTDIO): Simplify. 2003-06-12 03:24:16 +00:00
stdc++.h stdc++.h: New. 2003-03-14 22:16:06 +00:00