Skip handleMalloc properly.
authorMilian Wolff <mail@milianw.de>
Thu, 15 May 2014 17:43:46 +0000 (19:43 +0200)
committerMilian Wolff <mail@milianw.de>
Thu, 15 May 2014 17:43:46 +0000 (19:43 +0200)
malloctrace.cpp

index 436151a..13689bf 100644 (file)
@@ -89,9 +89,11 @@ void print_caller()
     unw_cursor_t cursor;
     unw_init_local (&cursor, &uc);
 
-    // skip malloc
-    if (unw_step(&cursor) <= 0) {
-        return;
+    // skip handleMalloc & malloc
+    for (int i = 0; i < 2; ++i) {
+        if (unw_step(&cursor) <= 0) {
+            return;
+        }
     }
 
     auto& ipCache = threadData.ipCache;