]> granicus.if.org Git - libatomic_ops/log
libatomic_ops
5 years agoTravis CI: Update to Xenial image master
Ivan Maidanski [Sun, 23 Jun 2019 08:48:02 +0000 (11:48 +0300)]
Travis CI: Update to Xenial image

Xenial is used by default on Travis as of now.

This commit contains the following changes
* number of make parallel jobs is reduced to 8 when building cppcheck
* clang-5.0 is replaced with clang
* sudo:required is removed (for sanitized builds)

5 years agoUpdate ChangeLog file (v7.6 changes)
Ivan Maidanski [Mon, 25 Mar 2019 14:43:28 +0000 (17:43 +0300)]
Update ChangeLog file (v7.6 changes)

5 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Mon, 25 Mar 2019 14:34:09 +0000 (17:34 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)
(a cherry-pick of commit e037be6cf from 'release-7_4')

5 years agoRefine and reformat description of size prefix in README_details
Ivan Maidanski [Wed, 13 Mar 2019 20:48:29 +0000 (23:48 +0300)]
Refine and reformat description of size prefix in README_details

* doc/README_details.txt (OPERATIONS): Refine information about the
size prefix.
* doc/README_details.txt (ORDERING CONSTRAINTS): Likewise.
* doc/README_details.txt (OPERATIONS): Put information about
AO_test_and_set after the section describing size prefix.

5 years agoDocument CAS operations better in README_details
Ivan Maidanski [Wed, 13 Mar 2019 19:01:43 +0000 (22:01 +0300)]
Document CAS operations better in README_details

* doc/README_details.txt: Mention that CAS operation has a "fetch"
variant; mention that all provided CAS operations are strong (i.e.
cannot fail spuriously).

5 years agoRemove outdated notes in README_details
Ivan Maidanski [Wed, 13 Mar 2019 08:34:22 +0000 (11:34 +0300)]
Remove outdated notes in README_details

* doc/README_details.txt: Remove notes that work is in progress;
mention that many operation have size variants, not few; remove note
that no good reason to provide operations on standard int types.

5 years agoDescribe double_compare_and_swap operation in README_details
Ivan Maidanski [Wed, 13 Mar 2019 08:22:52 +0000 (11:22 +0300)]
Describe double_compare_and_swap operation in README_details

* doc/README_details.txt: Describe double_compare_and_swap; refine
note about stack-allocated AO variables.

5 years agoFix library name in README_details
Ivan Maidanski [Tue, 12 Mar 2019 21:16:19 +0000 (00:16 +0300)]
Fix library name in README_details

* doc/README_details.txt: Fix typo ("libatomic_ops_gpl.a").

5 years agoUpdate README_win32 to match Makefile.msft
Ivan Maidanski [Tue, 12 Mar 2019 17:57:56 +0000 (20:57 +0300)]
Update README_win32 to match Makefile.msft

* doc/README_win32.txt: Update info about MS build tools (remove
"currently"); specify that "check" goal should be passed to nmake to
build and run the tests; remove an outdated note that warnings about
the types of the "Interlocked" functions may be printed.

5 years agoUpdate AUTHORS file
Ivan Maidanski [Wed, 6 Mar 2019 08:53:45 +0000 (11:53 +0300)]
Update AUTHORS file

5 years agoSupport MSYS host (configure)
Alexey Pavlov [Mon, 10 Dec 2018 12:39:32 +0000 (15:39 +0300)]
Support MSYS host (configure)

* configure.ac [$host=*-*-msys*] (PICFLAG): Set to empty.
* configure.ac [$have_pthreads=true && $host=*-*-msys*] (THREADDLLIBS):
Likewise.

5 years agoUpdate copyright year in configure and README
Ivan Maidanski [Wed, 6 Mar 2019 08:27:53 +0000 (11:27 +0300)]
Update copyright year in configure and README

* README.md: Update year (to 2019) in the Copyright.
* configure.ac: Likewise.

5 years agoUpdate ChangeLog file (set v7.6.10 release date)
Ivan Maidanski [Fri, 1 Mar 2019 16:23:46 +0000 (19:23 +0300)]
Update ChangeLog file (set v7.6.10 release date)

5 years agoUpdate ChangeLog file (v7.6 changes)
Ivan Maidanski [Fri, 1 Mar 2019 15:40:29 +0000 (18:40 +0300)]
Update ChangeLog file (v7.6 changes)

5 years agoUpdate ChangeLog file (set v7.4.14 release date)
Ivan Maidanski [Fri, 1 Mar 2019 15:28:20 +0000 (18:28 +0300)]
Update ChangeLog file (set v7.4.14 release date)

5 years ago.gitignore: Ignore /out folder
Ivan Maidanski [Tue, 26 Feb 2019 08:42:22 +0000 (11:42 +0300)]
.gitignore: Ignore /out folder

5 years agoFix 'duplicate symbol' error for test_malloc/stack with static libs (OS X)
Ivan Maidanski [Tue, 26 Feb 2019 08:40:21 +0000 (11:40 +0300)]
Fix 'duplicate symbol' error for test_malloc/stack with static libs (OS X)

If configured with --enable-static (the default behavior), libtool
passes libatomic_ops.a to gcc twice (with a relative path and with
an absolute one) when linking test_malloc and test_stack because
the latter ones use also depend on libatomic_ops_gpl.a which, in turn,
depends on libatomic_ops.a.  Double specification of  libatomic_ops.a
confuses ld tool of MacOS 10.14.

The workaround is to omit libatomic_ops.la in *_LDADD specification
for test_malloc and test_stack at least when the shared libraries are
not requested.

* configure.ac (ENABLE_SHARED): New AM_CONDITIONAL.
* tests/Makefile.am (test_stack_LDADD, test_malloc_LDADD): Do not add
libatomic_ops.la unless ENABLE_SHARED; add comment.

5 years agoUpdate ChangeLog file (v7.6 changes)
Ivan Maidanski [Fri, 25 Jan 2019 23:04:32 +0000 (02:04 +0300)]
Update ChangeLog file (v7.6 changes)

5 years agoUpdate ChangeLog file (v7.4 changes only)
Ivan Maidanski [Fri, 25 Jan 2019 22:53:16 +0000 (01:53 +0300)]
Update ChangeLog file (v7.4 changes only)
(a cherry-pick of commit 95bfa87 from 'release-7_4')

5 years agoUpdate AUTHORS file (add Max Horn)
Ivan Maidanski [Thu, 3 Jan 2019 16:41:46 +0000 (19:41 +0300)]
Update AUTHORS file (add Max Horn)

5 years agoFix 'AO_*_TS_T is not defined' compiler warnings (GCC-8)
Max Horn [Wed, 2 Jan 2019 14:47:21 +0000 (15:47 +0100)]
Fix 'AO_*_TS_T is not defined' compiler warnings (GCC-8)

* src/atomic_ops.h [!AO_HAVE_CLEAR]: Replace "AO_AO_TS_T" with
"defined(AO_AO_TS_T)" and AO_CHAR_TS_T" with "defined(AO_CHAR_TS_T)",
respectively, in the "if" preprocessor directives.
* src/atomic_ops/generalize.h: Likewise.

6 years agoEliminate 'my_chunk_ptr-AO_initial_heap out of bounds' cppcheck warning
Ivan Maidanski [Wed, 19 Dec 2018 09:26:22 +0000 (12:26 +0300)]
Eliminate 'my_chunk_ptr-AO_initial_heap out of bounds' cppcheck warning

* src/atomic_ops_malloc.c (get_chunk): Replace p1-p2>limit expression
with (AO_t)p1>(AO_t)(p2+limit), where p1>=p2 and p2+limit does not
overflow.

6 years agoWorkaround 'argument to function assert is always 1' cppcheck warnings
Ivan Maidanski [Wed, 19 Dec 2018 09:12:34 +0000 (12:12 +0300)]
Workaround 'argument to function assert is always 1' cppcheck warnings

* src/atomic_ops_malloc.c (get_chunk): Skip assertion about
my_chunk_ptr value alignment if CPPCHECK.
* tests/test_malloc.c (DEFAULT_NTHREADS): Add comment about the
maximum value.
* tests/test_malloc.c (main): Remove assertion of nthreads value which
is set to DEFAULT_NTHREADS (ideally there should be a static_assert).
* tests/test_stack.c (main): Likewise.

6 years agoUpdate ChangeLog file (set v7.6.8 release date)
Ivan Maidanski [Tue, 11 Dec 2018 08:39:27 +0000 (11:39 +0300)]
Update ChangeLog file (set v7.6.8 release date)

6 years agoUpdate ChangeLog file (v7.6 changes)
Ivan Maidanski [Mon, 10 Dec 2018 22:58:51 +0000 (01:58 +0300)]
Update ChangeLog file (v7.6 changes)

6 years agoUpdate ChangeLog file (set v7.4.12 release date)
Ivan Maidanski [Mon, 10 Dec 2018 22:53:45 +0000 (01:53 +0300)]
Update ChangeLog file (set v7.4.12 release date)

6 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Mon, 10 Dec 2018 22:11:58 +0000 (01:11 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

6 years agoUndo incorrect fix of typos regarding 'an' article
Ivan Maidanski [Mon, 10 Dec 2018 21:38:54 +0000 (00:38 +0300)]
Undo incorrect fix of typos regarding 'an' article
(revert part of commit cbde60d)

* src/atomic_ops/sysdeps/icc/ia64.h (AO_char_load_acquire): Fix typo
("an ld.acq") in comment.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_XSIZE_load_acquire): Likewise.
* src/atomic_ops/sysdeps/icc/ia64.h (AO_short_load_acquire,
AO_int_load_acquire): Add comment (similar to that of
AO_char_load_acquire).
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_XSIZE_store_release): Fix typo ("an st.rel") in comment.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h:
Regenerate.
* src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h:
Likewise.

6 years agoUndefine AO_ARM_HAVE_* private macros after their usage
Ivan Maidanski [Wed, 5 Dec 2018 21:51:51 +0000 (00:51 +0300)]
Undefine AO_ARM_HAVE_* private macros after their usage
(fix of commit 9b7cecba)

* src/atomic_ops/sysdeps/gcc/arm.h (AO_ARM_HAVE_DMB, AO_ARM_HAVE_LDREX,
AO_ARM_HAVE_LDREXBH, AO_ARM_HAVE_LDREXD, AO_ARM_HAVE_SWP): Undefine at
the end of the file.

6 years agoUse standalone private macro to guard against AO_GCC_BARRIER redefinition
Ivan Maidanski [Wed, 5 Dec 2018 21:43:43 +0000 (00:43 +0300)]
Use standalone private macro to guard against AO_GCC_BARRIER redefinition
(code refactoring)

* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h:
Regenerate.
* src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_GCC_BARRIER): Define only if AO_HAVE_GCC_BARRIER is undefined.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
[!AO_HAVE_GCC_BARRIER] (AO_HAVE_GCC_BARRIER): Define macro.

6 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Mon, 3 Dec 2018 23:04:57 +0000 (02:04 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)
(a cherry-pick of commit 1145982 from 'release-7_4')

6 years agoUpdate ChangeLog file (v7.6 changes)
Ivan Maidanski [Tue, 27 Nov 2018 08:12:42 +0000 (11:12 +0300)]
Update ChangeLog file (v7.6 changes)

6 years agoEliminate 'casting signed to bigger unsigned int' CSA warning (test_stack)
Ivan Maidanski [Sat, 10 Nov 2018 06:24:16 +0000 (09:24 +0300)]
Eliminate 'casting signed to bigger unsigned int' CSA warning (test_stack)

* tests/test_stack.c (run_one_test): Change type of index, i local
variables from int to unsigned.
* tests/test_stack.c [VERBOSE] (run_one_test): Change type of j local
variable from int to unsigned; update print format specifier
accordingly.
* tests/test_stack.c (main): Change type of i local variable from int
to unsigned.

6 years agoTravis CI: Execute cppcheck without sudo and -U long
Ivan Maidanski [Thu, 8 Nov 2018 09:15:17 +0000 (12:15 +0300)]
Travis CI: Execute cppcheck without sudo and -U long

6 years agoUpdate ChangeLog file (v7.6 changes)
Ivan Maidanski [Mon, 29 Oct 2018 22:15:50 +0000 (01:15 +0300)]
Update ChangeLog file (v7.6 changes)

6 years agoUse GCC atomic primitives for aarch64-ilp32 double-wide operations
Ivan Maidanski [Fri, 26 Oct 2018 18:33:46 +0000 (21:33 +0300)]
Use GCC atomic primitives for aarch64-ilp32 double-wide operations

Issue #38 (libatomic_ops).

Both gcc and clang have correct support of 64-bit atomic primitives
on AArch64, so need to use inline assembly.

* src/atomic_ops/sysdeps/gcc/aarch64.h [!__clang__] (AO_double_load,
AO_double_load_acquire, AO_double_store, AO_double_store_release,
AO_double_compare_and_swap, AO_double_compare_and_swap_acquire,
AO_double_compare_and_swap_release, AO_double_compare_and_swap_full):
Do not define if __ILP32__ (unless AO_AARCH64_ASM_LOAD_STORE_CAS).
* src/atomic_ops/sysdeps/gcc/aarch64.h [!__clang__
|| AO_CLANG_PREREQ(3,9)] (AO_GCC_HAVE_double_SYNC_CAS): Do not define
if __ILP32__; update gcc version in comment.

6 years agoUpdate AUTHORS file (add Tautvydas Zilys)
Ivan Maidanski [Thu, 25 Oct 2018 22:59:15 +0000 (01:59 +0300)]
Update AUTHORS file (add Tautvydas Zilys)

6 years agoSupport UWP/arm64 target
Tautvydas Zilys [Mon, 10 Sep 2018 18:41:09 +0000 (11:41 -0700)]
Support UWP/arm64 target

* src/atomic_ops.h [_MSC_VER && _M_ARM64]: Include msftc/x86_64.h.

6 years agoTravis CI: Test nios2 architecture with a cross-compiler
Ivan Maidanski [Wed, 24 Oct 2018 23:01:53 +0000 (02:01 +0300)]
Travis CI: Test nios2 architecture with a cross-compiler

6 years agoFix 'Cannot implement CAS_full on this architecture' build error (nios2)
Ivan Maidanski [Wed, 24 Oct 2018 22:54:57 +0000 (01:54 +0300)]
Fix 'Cannot implement CAS_full on this architecture' build error (nios2)

* src/atomic_ops.h [__GNUC__ && !AO_USE_PTHREAD_DEFS
&& !__INTEL_COMPILER && __nios2__] (AO_CAN_EMUL_CAS): Define macro.

6 years agoTravis CI: Test sh2 and s390 targets with cross-compilers
Ivan Maidanski [Wed, 24 Oct 2018 21:52:13 +0000 (00:52 +0300)]
Travis CI: Test sh2 and s390 targets with cross-compilers

6 years agoTravis CI: Test arm, mips, ppc targets without GCC atomic primitives
Ivan Maidanski [Wed, 24 Oct 2018 21:49:31 +0000 (00:49 +0300)]
Travis CI: Test arm, mips, ppc targets without GCC atomic primitives

6 years agoTravis CI: Test aarch64-ilp32 target with a cross-compiler
Ivan Maidanski [Wed, 24 Oct 2018 21:45:41 +0000 (00:45 +0300)]
Travis CI: Test aarch64-ilp32 target with a cross-compiler

6 years agoTravis CI: Test riscv32 and riscv64 linux targets with a cross-compiler
Ivan Maidanski [Wed, 24 Oct 2018 21:40:19 +0000 (00:40 +0300)]
Travis CI: Test riscv32 and riscv64 linux targets with a cross-compiler

Issue #31 (libatomic_ops).

6 years agoTravis CI: Update cross-compiler toolchains to v8.1.0
Ivan Maidanski [Wed, 24 Oct 2018 21:33:26 +0000 (00:33 +0300)]
Travis CI: Update cross-compiler toolchains to v8.1.0
(except for avr32, cris, ppc64le, s390x, tilegx)

6 years agoSupport ILP32 in AArch64 assembly routines (GCC)
Frank Schaefer [Wed, 24 Oct 2018 03:11:02 +0000 (22:11 -0500)]
Support ILP32 in AArch64 assembly routines (GCC)

Issue #38 (libatomic_ops).

* src/atomic_ops/sysdeps/gcc/aarch64.h [(!__clang__
|| AO_AARCH64_ASM_LOAD_STORE_CAS) && !AO_PREFER_GENERALIZED
&& __ILP32__] (AO_double_load, AO_double_load_acquire, AO_double_store,
AO_double_store_release): Specify the size ("w") of arguments of the
aarch64 instructions.
* src/atomic_ops/sysdeps/gcc/aarch64.h [(!__clang__
|| AO_AARCH64_ASM_LOAD_STORE_CAS) && __ILP32__]
(AO_double_compare_and_swap, AO_double_compare_and_swap_acquire,
AO_double_compare_and_swap_release, AO_double_compare_and_swap_full):
Likewise.

6 years agoWorkaround 'condition my_chunk_ptr is always false' cppcheck false positive
Ivan Maidanski [Fri, 19 Oct 2018 18:13:19 +0000 (21:13 +0300)]
Workaround 'condition my_chunk_ptr is always false' cppcheck false positive

* src/atomic_ops_malloc.c (get_chunk): Move get_mmaped() call into the
for loop; replace return statement inside the loop with break.

6 years agoFix typos in arm_v6.h, ia64.h, acquire_release_volatile.template
Ivan Maidanski [Thu, 13 Sep 2018 07:50:21 +0000 (10:50 +0300)]
Fix typos in arm_v6.h, ia64.h, acquire_release_volatile.template

* src/atomic_ops/sysdeps/armcc/arm_v6.h [!AO_UNIPROCESSOR]
(AO_nop_full): Fix typo ("a data memory barrier") in comment.
* src/atomic_ops/sysdeps/icc/ia64.h (AO_char_load_acquire): Fix typo
("a ld.acq instruction") in comment.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_XSIZE_load_acquire): Likewise.
* src/atomic_ops/sysdeps/icc/ia64.h (AO_short_load_acquire,
AO_int_load_acquire): Remove comment duplicating that in
AO_char_load_acquire.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_XSIZE_store_release): Fix typo ("a st.rel instruction") in comment.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h:
Regenerate.
* src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h:
Likewise.

6 years agoTravis CI: Put GNU S/W download base URL in a dedicated variable
Ivan Maidanski [Wed, 5 Sep 2018 20:38:54 +0000 (23:38 +0300)]
Travis CI: Put GNU S/W download base URL in a dedicated variable

6 years agoEliminate 'redundant blank line at start/end of block' CodeFactor warning
Ivan Maidanski [Mon, 3 Sep 2018 20:21:18 +0000 (23:21 +0300)]
Eliminate 'redundant blank line at start/end of block' CodeFactor warning
(code refactoring)

* src/atomic_ops/sysdeps/armcc/arm_v6.h (AO_test_and_set): Remove
redundant blank line at the start of a code block.
* src/atomic_ops/sysdeps/hpc/ia64.h (AO_fetch_compare_and_swap_release,
AO_char_fetch_compare_and_swap_acquire,
AO_char_fetch_compare_and_swap_release,
AO_short_fetch_compare_and_swap_acquire,
AO_short_fetch_compare_and_swap_release): Remove redundant blank line
at the end of a code block.

6 years agoAdd Codecov.io badge to README
Ivan Maidanski [Mon, 3 Sep 2018 20:05:49 +0000 (23:05 +0300)]
Add Codecov.io badge to README

6 years agoTravis CI: Send code coverage reports to Codecov as well
Ivan Maidanski [Mon, 3 Sep 2018 20:03:19 +0000 (23:03 +0300)]
Travis CI: Send code coverage reports to Codecov as well

6 years agoAdd LGTM.com code quality badges to README
Xavier Rene-Corail [Thu, 30 Aug 2018 10:05:30 +0000 (12:05 +0200)]
Add LGTM.com code quality badges to README

6 years agoUpdate ChangeLog file (add v7.6.6 release date)
Ivan Maidanski [Tue, 7 Aug 2018 07:55:08 +0000 (10:55 +0300)]
Update ChangeLog file (add v7.6.6 release date)

6 years agoUpdate ChangeLog file (v7.6 changes)
Ivan Maidanski [Mon, 6 Aug 2018 20:59:25 +0000 (23:59 +0300)]
Update ChangeLog file (v7.6 changes)

6 years agoUpdate copyright information in README and some header files
Ivan Maidanski [Thu, 26 Jul 2018 05:56:17 +0000 (08:56 +0300)]
Update copyright information in README and some header files

* README.md (Copyright & Warranty): Add copyrights from the source
code files.
* src/atomic_ops.h: Update header copyright (add Ivan Maidanski).
* src/atomic_ops/ao_version.h: Likewise.
* src/atomic_ops/sysdeps/gcc/aarch64.h: Likewise.
* src/atomic_ops/sysdeps/gcc/arm.h: Likewise.
* src/atomic_ops/sysdeps/gcc/generic.h: Likewise.
* src/atomic_ops/sysdeps/gcc/x86.h: Likewise.
* src/atomic_ops/sysdeps/loadstore/double_atomic_load_store.h:
Likewise.
* src/atomic_ops/sysdeps/msftc/arm.h: Likewise.
* src/atomic_ops/sysdeps/msftc/common32_defs.h: Likewise.
* src/atomic_ops/sysdeps/sunc/x86.h: Likewise.

6 years agoCOPYING: sync with FSF's gpl-2.0.txt
Pavel Raiskup [Wed, 18 Jul 2018 07:48:58 +0000 (09:48 +0200)]
COPYING: sync with FSF's gpl-2.0.txt

6 years agoTravis CI: Upgrade gcc-7 to gcc-8
Ivan Maidanski [Mon, 4 Jun 2018 19:30:58 +0000 (22:30 +0300)]
Travis CI: Upgrade gcc-7 to gcc-8

6 years agoTravis CI: Upgrade clang-4.0 to clang-5.0, and gcc-5 to gcc-7
Ivan Maidanski [Mon, 4 Jun 2018 08:05:01 +0000 (11:05 +0300)]
Travis CI: Upgrade clang-4.0 to clang-5.0, and gcc-5 to gcc-7

6 years agoFix comments style in configure.ac and Makefile.am
Ivan Maidanski [Fri, 18 May 2018 17:46:38 +0000 (20:46 +0300)]
Fix comments style in configure.ac and Makefile.am
(code refactoring)

Do not allow the comments that are meaningless in the auto-generated
configure and Makefile.in to be put to these files.

* Makefile.am (check-nolink): Change comment style from "#" to "##".
* configure.ac: Add the copyright and disclaimer.
* configure.ac: Change comment style from "#" to "dnl" for the comments
that are meaningless in auto-generated configure file.

6 years agoFix a typo in the overview section of README
Ivan Maidanski [Mon, 2 Apr 2018 19:52:18 +0000 (22:52 +0300)]
Fix a typo in the overview section of README
(fix of commit 147988d9)

* README.md (Overview): Fix typo ("a number of") in documentation.

6 years agoFix 'undefined reference to __atomic_load/store/cas_16' error (gcc-7/x64)
Ivan Maidanski [Wed, 28 Mar 2018 22:42:38 +0000 (01:42 +0300)]
Fix 'undefined reference to __atomic_load/store/cas_16' error (gcc-7/x64)

Issue #34 (libatomic_ops).

* src/atomic_ops/sysdeps/gcc/x86.h [!AO_DISABLE_GCC_ATOMICS
&& !__APPLE_CC__ && !__clang__ && AO_GNUC_PREREQ(7, 0)
&& !AO_PREFER_BUILTIN_ATOMICS && !AO_THREAD_SANITIZER
&& !__MINGW32__] (AO_SKIPATOMIC_double_compare_and_swap_ANY,
AO_SKIPATOMIC_DOUBLE_LOAD_STORE_ANY): Define macro; add comment.

6 years agoTravis CI: Test with gcc-7/x86_64 and -march=native flag on Linux
Ivan Maidanski [Wed, 28 Mar 2018 22:14:48 +0000 (01:14 +0300)]
Travis CI: Test with gcc-7/x86_64 and -march=native flag on Linux

6 years agoUpdate ChangeLog file (add v7.6.4 release date)
Ivan Maidanski [Wed, 28 Mar 2018 22:38:12 +0000 (01:38 +0300)]
Update ChangeLog file (add v7.6.4 release date)

6 years agoUpdate ChangeLog file (v7.6 changes only)
Ivan Maidanski [Tue, 27 Mar 2018 07:38:23 +0000 (10:38 +0300)]
Update ChangeLog file (v7.6 changes only)

6 years agoUpdate AUTHORS file (add YunQiang Su)
Ivan Maidanski [Fri, 16 Mar 2018 07:05:24 +0000 (10:05 +0300)]
Update AUTHORS file (add YunQiang Su)

6 years agoSupport MIPS rel6
YunQiang Su [Fri, 16 Mar 2018 06:58:22 +0000 (09:58 +0300)]
Support MIPS rel6

Don't set mips2/3 for mips r6.  MIPS release 6 changes the encoding of
some instructions, including ll/sc.  Setting mips2/3 here produces the
binary with the old encoding (not compatible with mips r6).

This patch has no effect if gcc 4.9+ or clang 3.5+ unless
AO_DISABLE_GCC_ATOMICS is defined manually in CFLAGS.

* src/atomic_ops/sysdeps/gcc/mips.h [AO_DISABLE_GCC_ATOMICS
&& __mips_isa_rev>=6] (AO_MIPS_SET_ISA): Define to empty string
(instead of ".set mips2" or ".set mips3").

6 years agoUpdate ChangeLog file (v7.6 changes only)
Ivan Maidanski [Mon, 5 Mar 2018 22:33:22 +0000 (01:33 +0300)]
Update ChangeLog file (v7.6 changes only)

6 years agoEnable CAS for byte and short on RISC-V
Ivan Maidanski [Wed, 21 Feb 2018 07:58:33 +0000 (10:58 +0300)]
Enable CAS for byte and short on RISC-V

Issue #31 (libatomic_ops).

At least for gcc-7.2.0 does not define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
and __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 macros but, nonetheless, all the
provided CAS operations are lock-free (except for double-word).

* src/Makefile.am (nobase_private_HEADERS): Add gcc/riscv.h entry.
* src/atomic_ops.h [__GNUC__ && !AO_USE_PTHREAD_DEFS
&& !__INTEL_COMPILER && __riscv]: Include gcc/riscv.h file.
* src/atomic_ops/sysdeps/gcc/riscv.h: New file (include generic.h).
* src/atomic_ops/sysdeps/gcc/riscv.h (AO_GCC_FORCE_HAVE_CAS): Define
before include generic.h (and undefined at the end of file); add
comment about double-word operations.

6 years agoRemove gcc/nios2.h and gcc/riscv.h files, include gcc/generic.h directly
Ivan Maidanski [Mon, 19 Feb 2018 06:45:50 +0000 (09:45 +0300)]
Remove gcc/nios2.h and gcc/riscv.h files, include gcc/generic.h directly
(code refactoring)

* src/Makefile.am (nobase_private_HEADERS): Remove nios2.h, riscv.h
entries.
* src/atomic_ops.h [__GNUC__ && !AO_USE_PTHREAD_DEFS
&& !__INTEL_COMPILER]: Use #elif instead of #endif - #if pairs.
* src/atomic_ops.h [__GNUC__ && !AO_USE_PTHREAD_DEFS
&& !__INTEL_COMPILER && (__nios2__ || __riscv)]: Do not include
gcc/nios2.h and gcc/riscv.h files; gcc/generic.h is included instead.
* src/atomic_ops/sysdeps/gcc/nios2.h: Delete file.
* src/atomic_ops/sysdeps/gcc/riscv.h: Likewise.

6 years agoUpdate AUTHORS file (add Shea Levy)
Ivan Maidanski [Mon, 19 Feb 2018 06:07:11 +0000 (09:07 +0300)]
Update AUTHORS file (add Shea Levy)

6 years agoAdd RISC-V support
Shea Levy [Sun, 18 Feb 2018 05:47:44 +0000 (00:47 -0500)]
Add RISC-V support

Issue #31 (libatomic_ops).

* src/Makefile.am (nobase_private_HEADERS): Add riscv.h entry.
* src/atomic_ops.h [__riscv]: Include riscv.h file.
* src/atomic_ops/sysdeps/gcc/riscv.h: New file (just include generic.h).

6 years agoTravis CI: Test compilation of 'src' files as C++ ones (Clang)
Ivan Maidanski [Wed, 14 Feb 2018 07:06:28 +0000 (10:06 +0300)]
Travis CI: Test compilation of 'src' files as C++ ones (Clang)

6 years agoConvert atomic_ops_malloc.c to valid C++ code
Ivan Maidanski [Wed, 14 Feb 2018 06:54:29 +0000 (09:54 +0300)]
Convert atomic_ops_malloc.c to valid C++ code

Explicit pointer casts are added where necessary.

* src/atomic_ops_malloc.c [HAVE_MMAP] (get_mmaped): Cast result of
mmap() to char* (when assigned to "result" local variable).
* src/atomic_ops_malloc.c (AO_free): Cast AO_free_large() argument
to char*.

6 years agoTravis CI: Test compilation of C tests as C++ ones
Ivan Maidanski [Thu, 8 Feb 2018 22:14:51 +0000 (01:14 +0300)]
Travis CI: Test compilation of C tests as C++ ones

6 years agoConvert tests to valid C++ code
Ivan Maidanski [Thu, 8 Feb 2018 22:12:27 +0000 (01:12 +0300)]
Convert tests to valid C++ code

* tests/test_malloc.c (cons, dummy_test, run_one_test): Add explicit
cast of void* pointer (returned by malloc) to the type of the variable
the pointer is assigned to.
* tests/test_stack.c (add_elements): Likewise.

6 years agoFix public headers inclusion from clients C++ code
Ivan Maidanski [Thu, 8 Feb 2018 21:42:25 +0000 (00:42 +0300)]
Fix public headers inclusion from clients C++ code

Put declarations of exported variables and non-inline functions into
extern "C" blocks.

* src/atomic_ops/sysdeps/emul_cas.h [__cplusplus]
(AO_fetch_compare_and_swap_emulation,
AO_compare_double_and_swap_double_emulation, AO_store_full_emulation):
Wrap the prototypes (but not included headers).
* src/atomic_ops/sysdeps/gcc/x86.h [AO_WEAK_DOUBLE_CAS_EMULATION
&& __cplusplus] (AO_compare_double_and_swap_double_emulation): Likewise.
* src/atomic_ops/sysdeps/generic_pthread.h [__cplusplus] (AO_pt_lock):
Likewise.
* src/atomic_ops/sysdeps/sunc/sparc.h [__cplusplus]
(AO_test_and_set_full): Likewise.
* src/atomic_ops_malloc.h [__cplusplus] (AO_free, AO_malloc,
AO_malloc_enable_mmap): Likewise.
* src/atomic_ops_stack.h [__cplusplus]
(AO_stack_push_explicit_aux_release,
AO_stack_pop_explicit_aux_acquire, AO_stack_init,
AO_stack_push_release, AO_stack_pop_acquire): Likewise.
* tests/test_atomic.c [AO_TEST_EMULATION && __cplusplus]
(AO_store_full_emulation, AO_fetch_compare_and_swap_emulation,
AO_compare_double_and_swap_double_emulation): Likewise.
* src/atomic_ops/sysdeps/msftc/common32_defs.h [_MSC_VER<1400
&& __cplusplus]: Adjust comment for the end of extern "C" block.

6 years agoEliminate 'using argument that points at uninitialized var' cppcheck error
Ivan Maidanski [Tue, 30 Jan 2018 21:40:23 +0000 (00:40 +0300)]
Eliminate 'using argument that points at uninitialized var' cppcheck error

* tests/list_atomic.template [AO_HAVE_test_and_setXX]
(XSIZE_list_atomicXX): Initialize ts local variable (to
AO_TS_INITIALIZER).

6 years agoFix 'AO_pt_lock undefined' error if cross-compiling manually (MinGW)
Ivan Maidanski [Tue, 16 Jan 2018 08:50:35 +0000 (11:50 +0300)]
Fix 'AO_pt_lock undefined' error if cross-compiling manually (MinGW)

* tests/test_atomic.c [AO_USE_PTHREAD_DEFS] (main): Skip the test if
__MINGW32__ (even if AO_NO_PTHREADS is not defined).

6 years agoTravis CI: Test also with mingw-w64 cross-compiler for 32-bit target (x86)
Ivan Maidanski [Tue, 16 Jan 2018 08:43:10 +0000 (11:43 +0300)]
Travis CI: Test also with mingw-w64 cross-compiler for 32-bit target (x86)

6 years agoTravis CI: Fix ASan builds with Clang-4.0 and GCC-5 (add sudo)
Ivan Maidanski [Tue, 16 Jan 2018 08:27:39 +0000 (11:27 +0300)]
Travis CI: Fix ASan builds with Clang-4.0 and GCC-5 (add sudo)

6 years agoEliminate 'function is never used' cppcheck warning for load_before_cas
Ivan Maidanski [Thu, 28 Dec 2017 18:09:25 +0000 (21:09 +0300)]
Eliminate 'function is never used' cppcheck warning for load_before_cas
(fix commit 441415c8)

* src/atomic_ops_stack.c [!AO_USE_ALMOST_LOCK_FREE
&& AO_THREAD_SANITIZER && !AO_HAVE_compare_and_swap_double &&
!AO_HAVE_compare_double_and_swap_double] (load_before_cas): Define as
macro (not as a static function).

6 years agoTravis CI: Do not use 'trusty' build environment
Ivan Maidanski [Mon, 25 Dec 2017 06:37:41 +0000 (09:37 +0300)]
Travis CI: Do not use 'trusty' build environment

6 years agoUpdate version info of libatomic_ops_gpl.so to match that of v7.6.2
Ivan Maidanski [Mon, 25 Dec 2017 06:13:41 +0000 (09:13 +0300)]
Update version info of libatomic_ops_gpl.so to match that of v7.6.2

* src/Makefile.am (LIBATOMIC_OPS_GPL_VER_INFO): Increment revision
(bump version info of libatomic_ops_gpl.so to 2:2:1).

6 years agoUpdate ChangeLog file (add gc-7.6.2 release date)
Ivan Maidanski [Mon, 25 Dec 2017 06:05:40 +0000 (09:05 +0300)]
Update ChangeLog file (add gc-7.6.2 release date)

6 years agoUpdate ChangeLog file (v7.6 changes only)
Ivan Maidanski [Sun, 24 Dec 2017 07:36:55 +0000 (10:36 +0300)]
Update ChangeLog file (v7.6 changes only)

6 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Fri, 22 Dec 2017 16:30:29 +0000 (19:30 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

6 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Tue, 12 Dec 2017 14:54:03 +0000 (17:54 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)
(Cherry-pick commit e3fdda6 from 'release-7_4' branch.)

7 years agoUse dedicated no_sanitize_thread load/store instead of copy_before_cas
Ivan Maidanski [Thu, 21 Dec 2017 07:49:27 +0000 (10:49 +0300)]
Use dedicated no_sanitize_thread load/store instead of copy_before_cas
(fix commits 6ffda1db110b0dcc)

This is also a workaround for a TSan false positive reported
in AO_stack_pop_acquire.

* src/atomic_ops_stack.c (AO_copy_before_cas): Remove.
* src/atomic_ops_stack.c (store_before_cas): New static function (or
defined as a macro).
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE] (load_before_cas):
Likewiese.
* src/atomic_ops_stack.c (AO_stack_push_explicit_aux_release,
AO_stack_push_release): Use store_before_cas instead of
AO_copy_before_cas.
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE] (load_before_cas):
Add volatile to addr argument if Clang.
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE] (AO_stack_pop_acquire):
Use load_before_cas instead of AO_copy_before_cas.

7 years agoWorkaround TSan false positive in AO_stack_pop_explicit_aux_acquire
Ivan Maidanski [Wed, 20 Dec 2017 23:25:48 +0000 (02:25 +0300)]
Workaround TSan false positive in AO_stack_pop_explicit_aux_acquire
(fix commits c058d9d6ffda1db)

The TSan-related workaround in AO_malloc is no longer needed.

* src/atomic_ops_malloc.c [AO_THREAD_SANITIZER
&& AO_USE_ALMOST_LOCK_FREE] (AO_malloc): Do not use AO_store (always
use *result=log_sz); remove comment.
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE
&& AO_THREAD_SANITIZER] (AO_load_next): New static function (with
AO_ATTR_NO_SANITIZE_THREAD attribute); add comments.
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE
&& !AO_THREAD_SANITIZER] (AO_load_next): Define to AO_load.
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE]
(AO_stack_pop_explicit_aux_acquire): Replace AO_load(first_ptr) with
AO_load_next(first_ptr).

7 years agoTravis CI: Test DONT_USE_MMAP (Linux)
Ivan Maidanski [Wed, 20 Dec 2017 22:54:59 +0000 (01:54 +0300)]
Travis CI: Test DONT_USE_MMAP (Linux)

7 years agoTravis CI: Test AO_USE_ALMOST_LOCK_FREE in more configurations
Ivan Maidanski [Wed, 20 Dec 2017 22:46:27 +0000 (01:46 +0300)]
Travis CI: Test AO_USE_ALMOST_LOCK_FREE in more configurations
(fix commits e0411c61468661)

7 years agoTravis CI: Test with AO_STACK_PREFER_CAS_DOUBLE
Ivan Maidanski [Wed, 20 Dec 2017 22:04:31 +0000 (01:04 +0300)]
Travis CI: Test with AO_STACK_PREFER_CAS_DOUBLE

7 years agoTravis CI: Test malloc/stack with AO_USE_PTHREAD_DEFS
Ivan Maidanski [Wed, 20 Dec 2017 21:57:53 +0000 (00:57 +0300)]
Travis CI: Test malloc/stack with AO_USE_PTHREAD_DEFS

7 years agoNew macro to select stack implementation based on CAS-double
Ivan Maidanski [Wed, 20 Dec 2017 21:52:57 +0000 (00:52 +0300)]
New macro to select stack implementation based on CAS-double

The macro is AO_STACK_PREFER_CAS_DOUBLE.  This is only for testing.

* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE
&& AO_HAVE_compare_double_and_swap_double && AO_STACK_PREFER_CAS_DOUBLE
&& AO_HAVE_compare_and_swap_double] (AO_stack_pop_acquire,
AO_stack_pop_acquire): Use implementation based compare_and_swap_double
instead of compare_double_and_swap_double); remove #error directive.

7 years agoPrevent too long run of test_atomic_generalized (especially with TSan)
Ivan Maidanski [Wed, 20 Dec 2017 21:37:54 +0000 (00:37 +0300)]
Prevent too long run of test_atomic_generalized (especially with TSan)

* tests/test_atomic.c [AO_PREFER_GENERALIZED] (NITERS): Set to a smaller
value (the same one as for AO_USE_PTHREAD_DEFS).

7 years agoFill in allocated memory with values depending on thread id (test_malloc)
Ivan Maidanski [Wed, 20 Dec 2017 07:31:07 +0000 (10:31 +0300)]
Fill in allocated memory with values depending on thread id (test_malloc)

* tests/test_malloc.c (run_one_test): Define new local variables a, b
(with the values depending on arg); replace 'a' and 'b' with a and b,
respectively; reformat the code; return NULL instead of arg; remove
the comment (the workaround is no longer needed).

7 years agoEliminate GCC-5 ASan global-buffer-overflow false positive for AO_stack_bl
Ivan Maidanski [Wed, 20 Dec 2017 07:22:20 +0000 (10:22 +0300)]
Eliminate GCC-5 ASan global-buffer-overflow false positive for AO_stack_bl

* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE]
(AO_stack_push_explicit_aux_release): Replace a->AO_stack_bl+i with
&a->AO_stack_bl[i] (including the case of i==0).

7 years agoMark unallocated/freed memory as inaccessible using ASan functionality
Ivan Maidanski [Wed, 20 Dec 2017 07:11:54 +0000 (10:11 +0300)]
Mark unallocated/freed memory as inaccessible using ASan functionality

Note: to disable it, AO_NO_MALLOC_POISON should be defined by client.

* src/atomic_ops_malloc.c [AO_ADDRESS_SANITIZER && !AO_NO_MALLOC_POISON]
(__asan_poison_memory_region, __asan_unpoison_memory_region): Prototype.
* src/atomic_ops_malloc.c (ASAN_POISON_MEMORY_REGION,
ASAN_UNPOISON_MEMORY_REGION): New macro.
* src/atomic_ops_malloc.c (add_chunk_as): Call
ASAN_POISON_MEMORY_REGION() for each pushed region.
* src/atomic_ops_malloc.c (AO_malloc): Call
ASAN_UNPOISON_MEMORY_REGION() for the returned memory region.
* src/atomic_ops_malloc.c (AO_free): Call ASAN_POISON_MEMORY_REGION()
before pushing the freed region to AO_free_list.

7 years agoTravis CI: Test AO_USE_ALMOST_LOCK_FREE macro also with ASan
Ivan Maidanski [Wed, 20 Dec 2017 07:00:28 +0000 (10:00 +0300)]
Travis CI: Test AO_USE_ALMOST_LOCK_FREE macro also with ASan
(fix commit e0411c6)