[前][次][番号順一覧][スレッド一覧]

ruby-changes:55337

From: k0kubun <ko1@a...>
Date: Sun, 14 Apr 2019 16:10:40 +0900 (JST)
Subject: [ruby-changes:55337] k0kubun:r67545 (trunk): Do not reset non-increment-only counters

k0kubun	2019-04-14 16:10:34 +0900 (Sun, 14 Apr 2019)

  New Revision: 67545

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67545

  Log:
    Do not reset non-increment-only counters
    
    to prevernt underflow.

  Modified files:
    trunk/debug_counter.c
Index: debug_counter.c
===================================================================
--- debug_counter.c	(revision 67544)
+++ debug_counter.c	(revision 67545)
@@ -47,7 +47,16 @@ VALUE https://github.com/ruby/ruby/blob/trunk/debug_counter.c#L47
 rb_debug_counter_reset(void)
 {
     for (int i = 0; i < RB_DEBUG_COUNTER_MAX; i++) {
-        rb_debug_counter[i] = 0;
+        switch (i) {
+          case RB_DEBUG_COUNTER_mjit_length_unit_queue:
+          case RB_DEBUG_COUNTER_mjit_length_active_units:
+          case RB_DEBUG_COUNTER_mjit_length_compact_units:
+            // These counters may be decreased and should not be reset.
+            break;
+          default:
+            rb_debug_counter[i] = 0;
+            break;
+        }
     }
     return Qnil;
 }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]