From 0e475fc7f0a54a96f047aa1e1b79a83cfa6415ad Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 29 Nov 2017 01:05:47 +0300 Subject: [PATCH] Remove redundant THREADS macro checks (code refactoring) THREAD_LOCAL_ALLOC macro implies THREADS one. * alloc.c [GC_ASSERTIONS && THREAD_LOCAL_ALLOC] (GC_check_fl_marks, GC_check_tls, GC_finish_collection): Do not check whether THREADS macro is defined. * include/private/gc_priv.h [GC_ASSERTIONS && THREAD_LOCAL_ALLOC] (GC_check_fl_marks): Likewise. --- alloc.c | 6 +++--- include/private/gc_priv.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/alloc.c b/alloc.c index 818e21f..825d515 100644 --- a/alloc.c +++ b/alloc.c @@ -830,7 +830,7 @@ GC_INNER void GC_set_fl_marks(ptr_t q) } } -#if defined(GC_ASSERTIONS) && defined(THREADS) && defined(THREAD_LOCAL_ALLOC) +#if defined(GC_ASSERTIONS) && defined(THREAD_LOCAL_ALLOC) /* Check that all mark bits for the free list whose first entry is */ /* (*pfreelist) are set. Check skipped if points to a special value. */ void GC_check_fl_marks(void **pfreelist) @@ -914,7 +914,7 @@ STATIC void GC_clear_fl_marks(ptr_t q) } } -#if defined(GC_ASSERTIONS) && defined(THREADS) && defined(THREAD_LOCAL_ALLOC) +#if defined(GC_ASSERTIONS) && defined(THREAD_LOCAL_ALLOC) void GC_check_tls(void); #endif @@ -938,7 +938,7 @@ STATIC void GC_finish_collection(void) CLOCK_TYPE finalize_time = 0; # endif -# if defined(GC_ASSERTIONS) && defined(THREADS) \ +# if defined(GC_ASSERTIONS) \ && defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL) /* Check that we marked some of our own data. */ /* FIXME: Add more checks. */ diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 5fe89f6..0e7d2b6 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -1745,7 +1745,7 @@ GC_INNER void GC_set_hdr_marks(hdr * hhdr); GC_INNER void GC_set_fl_marks(ptr_t p); /* Set all mark bits associated with */ /* a free list. */ -#if defined(GC_ASSERTIONS) && defined(THREADS) && defined(THREAD_LOCAL_ALLOC) +#if defined(GC_ASSERTIONS) && defined(THREAD_LOCAL_ALLOC) void GC_check_fl_marks(void **); /* Check that all mark bits */ /* associated with a free list are */ -- 2.7.4