Workaround 'local variable size too big' static analyzer warning
authorIvan Maidanski <ivmai@mail.ru>
Mon, 3 Oct 2016 07:22:59 +0000 (10:22 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 3 Oct 2016 07:22:59 +0000 (10:22 +0300)
* mark.c [PARALLEL_MARK] (LOCAL_MARK_STACK_SIZE): Define to smaller
value if LINT2 (to avoid static analysis tool warning that
local_mark_stack local variable size is very big).

mark.c

diff --git a/mark.c b/mark.c
index e8d46ba..21ec553 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -898,10 +898,14 @@ STATIC unsigned GC_active_count = 0;    /* Number of active helpers.    */
 
 GC_INNER word GC_mark_no = 0;
 
-#define LOCAL_MARK_STACK_SIZE HBLKSIZE
+#ifdef LINT2
+# define LOCAL_MARK_STACK_SIZE (HBLKSIZE / 8)
+#else
+# define LOCAL_MARK_STACK_SIZE HBLKSIZE
         /* Under normal circumstances, this is big enough to guarantee  */
         /* we don't overflow half of it in a single call to             */
         /* GC_mark_from.                                                */
+#endif
 
 /* Wait all markers to finish initialization (i.e. store        */
 /* marker_[b]sp, marker_mach_threads, GC_marker_Id).            */