[gjs/april-maintenance: 5/14] mem: Abort if counters are <0 as well as >0



commit ccb5385c65c6809241c81c00cddaf9370c100720
Author: Philip Chimento <philip chimento gmail com>
Date:   Thu Apr 30 21:54:59 2020 -0700

    mem: Abort if counters are <0 as well as >0
    
    In order to prevent bugs like the previous, make sure that all counters
    are exactly 0 at the end of the run, not just not greater than 0.

 gjs/mem.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gjs/mem.cpp b/gjs/mem.cpp
index ebf0ded1..d9a551ba 100644
--- a/gjs/mem.cpp
+++ b/gjs/mem.cpp
@@ -68,7 +68,7 @@ gjs_memory_report(const char *where,
               "  %d objects currently alive",
               GJS_GET_COUNTER(everything));
 
-    if (GJS_GET_COUNTER(everything) > 0) {
+    if (GJS_GET_COUNTER(everything) != 0) {
         for (i = 0; i < n_counters; ++i) {
             gjs_debug(GJS_DEBUG_MEMORY, "    %24s = %d", counters[i]->name,
                       counters[i]->value);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]