Remove redundant THREADS macro checks
authorIvan Maidanski <ivmai@mail.ru>
Tue, 28 Nov 2017 22:05:47 +0000 (01:05 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 28 Nov 2017 22:05:47 +0000 (01:05 +0300)
(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
include/private/gc_priv.h

diff --git a/alloc.c b/alloc.c
index 818e21f..825d515 100644 (file)
--- 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.                              */
index 5fe89f6..0e7d2b6 100644 (file)
@@ -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  */