diff options
| author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-13 20:59:42 +0000 |
|---|---|---|
| committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-13 20:59:42 +0000 |
| commit | 992fbba9318d732a032fc41255413d6cd462274c (patch) | |
| tree | 93548ad6fc3770e67322116c7c4cf63b2aaf9778 /libjava/gnu/java/lang/CharData.java | |
| parent | 903669fae3127b13f0a56a7d170744c8cf514339 (diff) | |
| download | ppe42-gcc-992fbba9318d732a032fc41255413d6cd462274c.tar.gz ppe42-gcc-992fbba9318d732a032fc41255413d6cd462274c.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67912 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/lang/CharData.java')
0 files changed, 0 insertions, 0 deletions

