]> granicus.if.org Git - gc/commitdiff
Allow GC_PAUSE_TIME_TARGET environment variable values smaller than 5 ms
authorIvan Maidanski <ivmai@mail.ru>
Fri, 12 Apr 2019 17:25:47 +0000 (20:25 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 12 Apr 2019 17:25:47 +0000 (20:25 +0300)
All time limit values starting from 1 ms are now accepted.

* misc.c [!GC_DISABLE_INCREMENTAL] (GC_init): Do not set GC_time_limit
if NO_CLOCK; allow all non-zero time_limit values (instead of >4);
do not call WARN() if time_limit value is incorrect.

misc.c

diff --git a/misc.c b/misc.c
index 4f3284ba948d83099e9418fde95fb4250128309f..30ce3c2399bfe348deed58d9da1b6d8bb6eb0716 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1091,15 +1091,12 @@ GC_API void GC_CALL GC_init(void)
         }
       }
 #   endif
-#   ifndef GC_DISABLE_INCREMENTAL
+#   if !defined(GC_DISABLE_INCREMENTAL) && !defined(NO_CLOCK)
       {
         char * time_limit_string = GETENV("GC_PAUSE_TIME_TARGET");
         if (0 != time_limit_string) {
           long time_limit = atol(time_limit_string);
-          if (time_limit < 5) {
-            WARN("GC_PAUSE_TIME_TARGET environment variable value too small "
-                 "or bad syntax: Ignoring\n", 0);
-          } else {
+          if (time_limit > 0) {
             GC_time_limit = time_limit;
           }
         }