]> granicus.if.org Git - gc/commitdiff
Fix 'set_pht_entry_from_index_concurrent value is unknown' cppcheck warning
authorIvan Maidanski <ivmai@mail.ru>
Fri, 9 Nov 2018 07:14:09 +0000 (10:14 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 23 Nov 2018 22:10:38 +0000 (01:10 +0300)
(fix of commit cdc201f40)

* blacklst.c [PARALLEL_MARK && THREAD_SANITIZER]
(backlist_set_pht_entry_from_index): Assume
set_pht_entry_from_index_concurrent is always defined.
* include/private/gc_priv.h [!THREADS || !AO_HAVE_or]
(set_pht_entry_from_index_concurrent): Define (to
set_pht_entry_from_index).
* include/private/gc_priv.h [THREADS && AO_HAVE_or]
(GC_acquire_dirty_lock, GC_release_dirty_lock): Define to empty.
* os_dep.c [!GC_DISABLE_INCREMENTAL && (!THREADS || AO_HAVE_or)]
(async_set_pht_entry_from_index): Define to
set_pht_entry_from_index_concurrent.

blacklst.c
include/private/gc_priv.h
os_dep.c

index 31511ae18e4fd3d6b19af0b55a7f6cd2df020006..45d1ef40f09aef72d65d02b7e97024f336fe3755 100644 (file)
@@ -175,8 +175,7 @@ GC_INNER void GC_unpromote_black_lists(void)
     GC_copy_bl(GC_old_stack_bl, GC_incomplete_stack_bl);
 }
 
-#if defined(set_pht_entry_from_index_concurrent) && defined(PARALLEL_MARK) \
-    && defined(THREAD_SANITIZER)
+#if defined(PARALLEL_MARK) && defined(THREAD_SANITIZER)
 # define backlist_set_pht_entry_from_index(db, index) \
                         set_pht_entry_from_index_concurrent(db, index)
 #else
index 728e74ea484e59b1b57425e5cd3a190030ee13f2..1d4df98076816a4c0eabf307d13e1dba76cd5703 100644 (file)
@@ -970,6 +970,9 @@ typedef word page_hash_table[PHT_SIZE];
 # define set_pht_entry_from_index_concurrent(bl, index) \
                 AO_or((volatile AO_t *)&(bl)[divWORDSZ(index)], \
                       (AO_t)((word)1 << modWORDSZ(index)))
+#else
+# define set_pht_entry_from_index_concurrent(bl, index) \
+                set_pht_entry_from_index(bl, index)
 #endif
 
 
@@ -2316,8 +2319,7 @@ GC_EXTERN signed_word GC_bytes_found;
                                 /* protected by GC_write_cs.    */
 
 # endif
-# if defined(GC_DISABLE_INCREMENTAL) \
-     || defined(set_pht_entry_from_index_concurrent)
+# if defined(GC_DISABLE_INCREMENTAL) || defined(AO_HAVE_or)
 #   define GC_acquire_dirty_lock() (void)0
 #   define GC_release_dirty_lock() (void)0
 # else
index 6eee61aa04e4a49ed41541b53f374c6fae32cf32..12d9fd72b96e7f14f70175a74213d9eca0024c62 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -2959,10 +2959,7 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void)
 #endif /* DEFAULT_VDB */
 
 #ifndef GC_DISABLE_INCREMENTAL
-# ifndef THREADS
-#   define async_set_pht_entry_from_index(db, index) \
-                        set_pht_entry_from_index(db, index)
-# elif defined(set_pht_entry_from_index_concurrent)
+# if !defined(THREADS) || defined(AO_HAVE_or)
 #   define async_set_pht_entry_from_index(db, index) \
                         set_pht_entry_from_index_concurrent(db, index)
 # elif defined(AO_HAVE_test_and_set_acquire)