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)
+# define backlist_set_pht_entry_from_index(db, index) \
+ set_pht_entry_from_index_concurrent(db, index)
+#else
+ /* It is safe to set a bit in a blacklist even without */
+ /* synchronization, the only drawback is that we might have */
+ /* to redo blacklisting sometimes. */
+# define backlist_set_pht_entry_from_index(bl, index) \
+ set_pht_entry_from_index(bl, index)
+#endif
+
/* P is not a valid pointer reference, but it falls inside */
/* the plausible heap bounds. */
/* Add it to the normal incomplete black list if appropriate. */
GC_print_blacklisted_ptr(p, source, "normal");
}
# endif
- set_pht_entry_from_index_concurrent(GC_incomplete_normal_bl, index);
+ backlist_set_pht_entry_from_index(GC_incomplete_normal_bl, index);
} /* else this is probably just an interior pointer to an allocated */
/* object, and isn't worth black listing. */
}
GC_print_blacklisted_ptr(p, source, "stack");
}
# endif
- set_pht_entry_from_index_concurrent(GC_incomplete_stack_bl, index);
+ backlist_set_pht_entry_from_index(GC_incomplete_stack_bl, index);
}
}
# define get_pht_entry_from_index(bl, index) \
(((bl)[divWORDSZ(index)] >> modWORDSZ(index)) & 1)
# define set_pht_entry_from_index(bl, index) \
- (bl)[divWORDSZ(index)] |= (word)1 << modWORDSZ(index)
+ (void)((bl)[divWORDSZ(index)] |= (word)1 << modWORDSZ(index))
-/* And, one more version for GC_add_to_black_list_normal/stack. */
-/* The latter ones are invoked (indirectly) by GC_do_local_mark. */
-#if defined(PARALLEL_MARK) && defined(THREAD_SANITIZER)
+#if defined(THREADS) && defined(AO_HAVE_or)
+ /* And, one more version for GC_add_to_black_list_normal/stack */
+ /* (invoked indirectly by GC_do_local_mark) and */
+ /* async_set_pht_entry_from_index (invoked by GC_dirty or the write */
+ /* fault handler). */
# define set_pht_entry_from_index_concurrent(bl, index) \
AO_or((volatile AO_t *)&(bl)[divWORDSZ(index)], \
(AO_t)((word)1 << modWORDSZ(index)))
-#else
- /* It is safe to set a bit in a blacklist even without */
- /* synchronization, the only drawback is that we might have */
- /* to redo blacklisting sometimes. */
-# define set_pht_entry_from_index_concurrent(bl, index) \
- set_pht_entry_from_index(bl, index)
#endif
/* protected by GC_write_cs. */
# endif
-# if defined(GC_DISABLE_INCREMENTAL)
+# if defined(GC_DISABLE_INCREMENTAL) \
+ || defined(set_pht_entry_from_index_concurrent)
# define GC_acquire_dirty_lock() (void)0
# define GC_release_dirty_lock() (void)0
# else
# 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)
+# 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)
/* We need to lock around the bitmap update (in the write fault */
/* handler or GC_dirty) in order to avoid the risk of losing a bit. */
/* We do this with a test-and-set spin lock if possible. */
GC_INNER volatile AO_TS_t GC_fault_handler_lock = AO_TS_INITIALIZER;
- GC_ATTR_NO_SANITIZE_THREAD
static void async_set_pht_entry_from_index(volatile page_hash_table db,
size_t index)
{