GC_print_blacklisted_ptr(p, source, "normal");
}
# endif
- set_pht_entry_from_index(GC_incomplete_normal_bl, index);
+ set_pht_entry_from_index_concurrent(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(GC_incomplete_stack_bl, index);
+ set_pht_entry_from_index_concurrent(GC_incomplete_stack_bl, index);
}
}
# define set_pht_entry_from_index_safe(bl, index) \
(bl)[divWORDSZ(index)] = ONES
+/* 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)
+# 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
+
/********************************************/
/* */