The root of the problem is that the existing implementation is based on the
ARM C++ ABI, which mandates a different guard variable layout than the
Itanium/x86 C++ one.
This patch modifies the implementation in a way that satisfies both ABIs (and
doesn't require changing the toolchains).
Change-Id: I885e9adc7f088b9c0a78355bd752f1e6aeec9f07
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
We're going to modify the __atomic_xxx implementation to provide
full memory barriers, to avoid problems for NDK machine code that
link to these functions.
First step is to remove their usage from our platform code.
We now use inlined versions of the same functions for a slight
performance boost.
+ remove obsolete atomics_x86.c (was never compiled)
NOTE: This improvement was benchmarked on various devices.
Comparing a pthread mutex lock + atomic increment + unlock
we get:
- ARMv7 emulator, running on a 2.4 GHz Xeon:
before: 396 ns after: 288 ns
- x86 emulator in KVM mode on same machine:
before: 27 ns after: 27 ns
- Google Nexus S, in ARMv7 mode (single-core):
before: 82 ns after: 76 ns
- Motorola Xoom, in ARMv7 mode (multi-core):
before: 121 ns after: 120 ns
The code has also been rebuilt in ARMv5TE mode for correctness.
Change-Id: Ic1dc72b173d59b2e7af901dd70d6a72fb2f64b17
This change ensures that operator new will call abort() in case
of memory allocation failure. Note that due to our usage of memory
overcommit, this can only happen under very rare circumstances
(i.e. trying to allocate memory larger than the larger free range
of virtual address space, or when memory is corrutped in various
ways).
Change-Id: I128b8bf626216e899c22a00f24492cd148a1fc94
(We remove the declaration for on_exit() from the C library headers,
so do the same for the C++ <cstdlib>)
Change-Id: I31a21d5643068cd160724908dd8156863a44d95a
This is needed to build an independent toolchain with g++ that doesn't think
that all these headers are in C.
Change-Id: Ie9a8ccfcab7780d6a4e5722777d61c2b1b312001
The only one left is cstring.
* bionic/libstdc++/include/cstdlib:
* bionic/libstdc++/include/cstdio:
* bionic/libstdc++/include/cstdint:
* bionic/libstdc++/include/csignal:
* bionic/libstdc++/include/csetjmp:
Added header file.
Checks the bionic headers file were picked up instead of the host ones.
Added test for new header files
* system/extras/tests/bionic/libstdc++/Android.mk:
Added tests for the new header files.
EXTRA_CFLAGS: include the bionic header files.
BUG=1601432
Automated import of CL 145059
Even if we don't want to have a bloated stl implementation, having empty
files around is probably not very good either.
Added a test to make sure the header file compiles on host and kila-eng.
QA Impact: In system/extras/test/bionic/libstdc++ build the tests using:
mm BIONIC_TESTS=1
to build the host and target tests.
BUG=1601432
Automated import of CL 143504