2
0
mirror of https://github.com/boostorg/atomic.git synced 2026-02-01 20:12:09 +00:00
Commit Graph

4 Commits

Author SHA1 Message Date
Andrey Semashev
34a2bc134c Fixed compilation on 32-bit x86, reduced code duplication.
On 32-bit x86, 64-bit integers have 4-byte alignment, which resulted in
a non-integral type being selected for storage type in case of lock-based
atomic_ref. This broke arithmetic and bitwise operations on atomic_ref.

We now select an integral type based on its native alignment, not the storage
alignment we require for atomic operations. This is fine in case of lock-based
backend.

Also, extended buffer_storage with support for specifying alignment and removed
aligned_buffer_storage and storage128_t.
2020-03-01 03:11:33 +03:00
Andrey Semashev
a1a31e14e2 Reduce alignment requirements of lock-based backend of atomic_ref.
Lock-based operations have no reason to require object alignment higher
than alignof(T). This commit implements a special storage type for
lock-based operations, which has the same alignment as value_type.

Also, added tests to verify required_alignment correctness both
in lock-free and lock-based cases.
2020-03-01 00:22:35 +03:00
Andrey Semashev
26c4d0dac4 Disabled int128 tests for clang-5 in Travis CI.
For some unknown reason, int128 bit operation tests started failing
in Travis CI for x86-64. The error does not reproduce locally. Given that
float128 were known to fail similarly (only on 32-bit target), it seems all
128-bit operations are broken in clang-5 (possibly caused by something
specific to Travis CI).

This commit re-enables 32-bit tests on clang-5, but disables int128 and
float128 tests on both 32 and 64-bit targets.
2020-02-28 22:38:58 +03:00
Andrey Semashev
904871c37d Implemented atomic_ref.
This commit adds C++20 atomic_ref implementation, documentation and tests.
2020-02-25 02:00:05 +03:00