Details
-
Improvement
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
4.1.3
-
None
-
x86_64
-
Inefficiency
Description
Atomic operations are disabled on AMD64 and EM64T.
$ uname -srp && cat t.cpp && make t && LD_LIBRARY_PATH=../lib:$LD_LIBRARY_PATH ./t
Linux 2.6.9-22.ELsmp x86_64
#include <cassert>
#include <string>
#include <pthread.h>
int main ()
{
typedef std::char_traits<char> Traits;
typedef std::allocator<char> Allocator;
typedef _rw::_string_ref<char, Traits, Allocator> strref;
struct SmallRef
{ int ref_count; std::string::size_type capacity; std::string::size_type size; };
struct LargeRef
{ pthread_mutex_t mutex; int ref_count; std::string::size_type capacity; std::string::size_type size; };
assert (sizeof (strref) <= sizeof (SmallRef));
assert (sizeof (strref) < sizeof (LargeRef));
}
gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -pthread -D_RWSTD_USE_CONFIG -I/build/sebor/gcc-3.4.4-15D/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/../rwtest -I/build/sebor/dev/stdlib/../rwtest/include -I/build/sebor/dev/stdlib/tests/include -pedantic -nostdinc++ -g -Wall -W -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align t.cpp
gcc t.o -o t -L/build/sebor/gcc-3.4.4-15D/rwtest -lrwtest15d -pthread -L/build/sebor/gcc-3.4.4-15D/lib -lstd15d -lsupc++ -lm
t: t.cpp:24: int main(): Assertion `sizeof (strref) <= sizeof (SmallRef)' failed.
Aborted
Attachments
Issue Links
- is duplicated by
-
STDCXX-518 std::string copy constructor slow
- Closed
- relates to
-
STDCXX-538 ATOMIC_OPS.cpp test fails to link (unresolved external symbol: _InterlockedIncrement)
- Closed
-
STDCXX-809 [Solaris Threads] notypenameerr error on thr_mutex_t in 21.string.stdcxx-162.cpp
- Closed