Skip to content

Commit

Permalink
Define a single macro which includes all GC_ATTR_NO_SANITIZE_x
Browse files Browse the repository at this point in the history
(refactoring)

Issue #364 (bdwgc).

* include/private/gc_priv.h (GC_ATTR_NO_SANITIZE_ADDR_MEM_THREAD):
Define macro.
* mark.c (GC_mark_from, GC_push_all_eager): Use
GC_ATTR_NO_SANITIZE_ADDR_MEM_THREAD instead of
GC_ATTR_NO_SANITIZE_ADDR, GC_ATTR_NO_SANITIZE_MEMORY and
GC_ATTR_NO_SANITIZE_THREAD.
* mark.c [WRAP_MARK_SOME && PARALLEL_MARK] (GC_push_conditional_eager):
Likewise.
  • Loading branch information
ivmai committed Sep 30, 2024
1 parent c26946a commit 94ea02e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions include/private/gc_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ typedef struct hblkhdr hdr;
# endif
#endif /* !GC_ATTR_NO_SANITIZE_THREAD */

#define GC_ATTR_NO_SANITIZE_ADDR_MEM_THREAD \
GC_ATTR_NO_SANITIZE_ADDR GC_ATTR_NO_SANITIZE_MEMORY \
GC_ATTR_NO_SANITIZE_THREAD

#ifndef UNUSED_ARG
# define UNUSED_ARG(arg) ((void)(arg))
#endif
Expand Down
7 changes: 3 additions & 4 deletions mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ STATIC mse * GC_signal_mark_stack_overflow(mse *msp)
* encoding, we optionally maintain a cache for the block address to
* header mapping, we prefetch when an object is "grayed", etc.
*/
GC_ATTR_NO_SANITIZE_ADDR GC_ATTR_NO_SANITIZE_MEMORY GC_ATTR_NO_SANITIZE_THREAD
GC_ATTR_NO_SANITIZE_ADDR_MEM_THREAD
GC_INNER mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack,
mse *mark_stack_limit)
{
Expand Down Expand Up @@ -1639,7 +1639,7 @@ GC_INNER void
/* A version of GC_push_all that treats all interior pointers as valid */
/* and scans the entire region immediately, in case the contents */
/* change. */
GC_ATTR_NO_SANITIZE_ADDR GC_ATTR_NO_SANITIZE_MEMORY GC_ATTR_NO_SANITIZE_THREAD
GC_ATTR_NO_SANITIZE_ADDR_MEM_THREAD
GC_API void GC_CALL GC_push_all_eager(void *bottom, void *top)
{
REGISTER ptr_t current_p;
Expand Down Expand Up @@ -1683,8 +1683,7 @@ GC_INNER void GC_push_all_stack(ptr_t bottom, ptr_t top)

#if defined(WRAP_MARK_SOME) && defined(PARALLEL_MARK)
/* Similar to GC_push_conditional but scans the whole region immediately. */
GC_ATTR_NO_SANITIZE_ADDR GC_ATTR_NO_SANITIZE_MEMORY
GC_ATTR_NO_SANITIZE_THREAD
GC_ATTR_NO_SANITIZE_ADDR_MEM_THREAD
GC_INNER void GC_push_conditional_eager(void *bottom, void *top,
GC_bool all)
{
Expand Down

0 comments on commit 94ea02e

Please sign in to comment.