Eliminate TSan warnings for all counters and A.aa variable (gctest)
Now most of the counters in gctest are updated using atomic increment.
And, the values of gctest dropped_something and A.aa variables are
updated and fetch using the atomic primitives.
* tests/test.c [!AO_CLEAR] (AO_t): Define.
* tests/test.c [!AO_HAVE_load] (AO_load): Define (as a non-atomic
operation).
* tests/test.c [!AO_HAVE_store] (AO_store): Likewise.
* tests/test.c [!AO_HAVE_fetch_and_add1] (AO_fetch_and_add1): Likewise.
* tests/test.c (stubborn_count, uncollectable_count,
collectable_count, atomic_count, realloc_count): Change type from int
to AO_t; add volatile qualifier; update comment; remove FIXME.
* tests/test.c (extra_count): Define unconditionally; change type from
int to AO_t; add volatile qualifier; update comment.
* tests/test.c [!VERY_SMALL_CONFIG] (cons): Use AO_fetch_and_add1 to
get and update the values of extra_count and stubborn_count.
* tests/test.c (small_cons_uncollectable): Use AO_fetch_and_add1 to
update the value of uncollectable_count.
* tests/test.c [!DBG_HDRS_ALL] (run_one_test): Likewise.
* tests/test.c [GC_GCJ_SUPPORT] (gcj_cons): Remove obj_cnt static
variable; use extra_count instead of obj_cnt; use AO_fetch_and_add1 to
get and update the value of extra_count.
* tests/test.c (A): Add volatile qualifier; change the type of aa
field from sexpr to AO_t.
* tests/test.c (a): Do not define (and undefine).
* tests/test.c (a_set, a_get): New macro (that uses AO_store/load).
* tests/test.c (reverse_test_inner): Use a_set() and a_get() to store
and fetch the value of a, respectively; use AO_fetch_and_add1 to
update the value of realloc_count.
* tests/test.c (dropped_something): Change type from int to AO_t.
* tests/test.c (counter): Remove.
* tests/test.c (mktree): Use extra_count instead of counter; use
AO_fetch_and_add1 to update the value of extra_count.
* tests/test.c [GC_PTHREADS && !SMALL_CONFIG && !GC_DEBUG]
(alloc8bytes): Use AO_fetch_and_add1 to update the value of
uncollectable_count.
* tests/test.c (alloc_small, run_one_test): Use AO_fetch_and_add1 to
update the value of atomic_count.
* tests/test.c (tree_test): Use AO_load and AO_store to get and set
the value of dropped_something, respectively.
* tests/test.c (check_heap_stats): Cast uncollectable_count,
atomic_count, stubborn_count, realloc_count to int in printf() call.