Avoid potential race in SET_MARK_BIT_EXIT_IF_SET if parallel marking
authorIvan Maidanski <ivmai@mail.ru>
Fri, 9 Mar 2018 20:23:56 +0000 (23:23 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 9 Mar 2018 20:23:56 +0000 (23:23 +0300)
commit9f377e845b112aed14e9a3c28e52b07b84599e49
treee884882909a685b88cfa86fa8753d3f99b992275
parent7b9a57cee1ccddd761a3ea5ca046e5c95df7dcc7
Avoid potential race in SET_MARK_BIT_EXIT_IF_SET if parallel marking

* include/private/gc_atomic_ops.h [GC_BUILTIN_ATOMIC] (AO_char_load,
AO_HAVE_char_load, AO_char_store, AO_HAVE_char_store): Define macro.
* include/private/gc_pmark.h [USE_MARK_BYTES && PARALLEL_MARK
&& AO_HAVE_char_store && !AO_USE_PTHREAD_DEFS]
(SET_MARK_BIT_EXIT_IF_SET): Use AO_char_load/store to access hb_marks.
* include/private/gc_pmark.h [!USE_MARK_BYTES && PARALLEL_MARK
&& THREAD_SANITIZER] (OR_WORD_EXIT_IF_SET): Use AO_load to fetch the
word at addr.
* tests/test_atomic_ops.c [AO_HAVE_char_load || AO_HAVE_char_store]
(main): Define c local variable.
* tests/test_atomic_ops.c [AO_HAVE_char_load] (main): Test AO_char_load.
* tests/test_atomic_ops.c [AO_HAVE_char_store] (main): Test
AO_char_store.
include/private/gc_atomic_ops.h
include/private/gc_pmark.h
tests/test_atomic_ops.c