Don't create single-entry trees output.
authorMilian Wolff <mail@milianw.de>
Thu, 15 May 2014 20:47:48 +0000 (22:47 +0200)
committerMilian Wolff <mail@milianw.de>
Thu, 15 May 2014 20:47:48 +0000 (22:47 +0200)
malloctrace.cpp

index 04bc65a..8766f6a 100644 (file)
@@ -192,6 +192,10 @@ unsigned int print_caller()
         }
     }
 
+    if (tree.depth == 1) {
+        return tree.data[0];
+    }
+
     auto& treeCache = threadData.treeCache;
     auto it = treeCache.find(tree);
     if (it == treeCache.end()) {