]> granicus.if.org Git - gc/commitdiff
Replace var-args GC_noop with fixed-args one
authorIvan Maidanski <ivmai@mail.ru>
Sun, 9 Sep 2012 07:15:48 +0000 (11:15 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 9 Sep 2012 07:28:37 +0000 (11:28 +0400)
(to suppress Clang warning that arguments were dropped)

* alloc.c (GC_stopped_mark, GC_try_to_collect_general): Use GC_noop6
instead of var-args GC_noop.
* include/private/gc_priv.h (GC_noop): Replace var-args (and
platform-specific) prototype with GC_noop6 one.
* mark.c (GC_noop): Replace with GC_noop6 (with all arguments
ignored); refine comment.

alloc.c
include/private/gc_priv.h
mark.c

diff --git a/alloc.c b/alloc.c
index fdb515ba81758a8c343966f4d2ccd38861ea3784..28d78e44a873436b883007ab7c6e6796bba5e1bc 100644 (file)
--- a/alloc.c
+++ b/alloc.c
@@ -627,7 +627,8 @@ STATIC GC_bool GC_stopped_mark(GC_stop_func stop_func)
     /* Mark from all roots.  */
         /* Minimize junk left in my registers and on the stack */
             GC_clear_a_few_frames();
-            GC_noop(0,0,0,0,0,0);
+            GC_noop6(0,0,0,0,0,0);
+
         GC_initiate_gc();
         for (i = 0;;i++) {
           if ((*stop_func)()) {
@@ -985,7 +986,7 @@ STATIC GC_bool GC_try_to_collect_general(GC_stop_func stop_func,
 #   endif
     ENTER_GC();
     /* Minimize junk left in my registers */
-      GC_noop(0,0,0,0,0,0);
+      GC_noop6(0,0,0,0,0,0);
     result = GC_try_to_collect_inner(stop_func != 0 ? stop_func :
                                      GC_default_stop_func);
     EXIT_GC();
index 6458bda62f2cc03926654867b074f7a7b4369950..823e2c5f094be668641cecbd15a4a0af2f815d01 100644 (file)
@@ -1993,15 +1993,7 @@ extern word GC_fo_entries; /* should be visible in extra/MacOS.c */
 #endif
 
 /* Make arguments appear live to compiler */
-#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__CC_ARM)
-  void GC_noop(void*, ...);
-#else
-# ifdef __DMC__
-    void GC_noop(...);
-# else
-    void GC_noop();
-# endif
-#endif
+void GC_noop6(word, word, word, word, word, word);
 
 GC_API void GC_CALL GC_noop1(word);
 
diff --git a/mark.c b/mark.c
index 29ee3f014a8291c5696c93dfe6da9910dd95ea97..50be939a21c7d7701ef981f4074505a016fe4f4f 100644 (file)
--- a/mark.c
+++ b/mark.c
 # include <excpt.h>
 #endif
 
-/* We put this here to minimize the risk of inlining. */
-/*VARARGS*/
-#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__CC_ARM)
-  void GC_noop(void * p GC_ATTR_UNUSED, ...) {}
-#else
-# ifdef __DMC__
-    void GC_noop(...) {}
-# else
-    void GC_noop() {}
-# endif
-#endif
+/* Make arguments appear live to compiler.  Put here to minimize the    */
+/* risk of inlining.  Used to minimize junk left in registers.          */
+void GC_noop6(word arg1 GC_ATTR_UNUSED, word arg2 GC_ATTR_UNUSED,
+              word arg3 GC_ATTR_UNUSED, word arg4 GC_ATTR_UNUSED,
+              word arg5 GC_ATTR_UNUSED, word arg6 GC_ATTR_UNUSED)
+{
+  /* Empty */
+}
 
 /* Single argument version, robust against whole program analysis. */
 volatile word GC_noop_sink;