summaryrefslogtreecommitdiffstats
path: root/third_party/tcmalloc/vendor/src/tests/heap-checker_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/tcmalloc/vendor/src/tests/heap-checker_unittest.cc')
-rw-r--r--third_party/tcmalloc/vendor/src/tests/heap-checker_unittest.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/third_party/tcmalloc/vendor/src/tests/heap-checker_unittest.cc b/third_party/tcmalloc/vendor/src/tests/heap-checker_unittest.cc
index 404c9f1..ab326c9 100644
--- a/third_party/tcmalloc/vendor/src/tests/heap-checker_unittest.cc
+++ b/third_party/tcmalloc/vendor/src/tests/heap-checker_unittest.cc
@@ -101,10 +101,10 @@
#include "base/logging.h"
#include "base/commandlineflags.h"
#include "base/thread_lister.h"
-#include <google/heap-checker.h>
+#include <gperftools/heap-checker.h>
#include "memory_region_map.h"
-#include <google/malloc_extension.h>
-#include <google/stacktrace.h>
+#include <gperftools/malloc_extension.h>
+#include <gperftools/stacktrace.h>
// On systems (like freebsd) that don't define MAP_ANONYMOUS, use the old
// form of the name instead.
@@ -1381,7 +1381,13 @@ int main(int argc, char** argv) {
RunHidden(NewCallback(MakeALeak, &arr));
Use(&arr);
LogHidden("Leaking", arr);
- if (FLAGS_test_cancel_global_check) HeapLeakChecker::CancelGlobalCheck();
+ if (FLAGS_test_cancel_global_check) {
+ HeapLeakChecker::CancelGlobalCheck();
+ } else {
+ // Verify we can call NoGlobalLeaks repeatedly without deadlocking
+ HeapLeakChecker::NoGlobalLeaks();
+ HeapLeakChecker::NoGlobalLeaks();
+ }
return Pass();
// whole-program leak-check should (with very high probability)
// catch the leak of arr (10 * sizeof(int) bytes)
@@ -1396,7 +1402,13 @@ int main(int argc, char** argv) {
Use(&arr2);
LogHidden("Loop leaking", arr1);
LogHidden("Loop leaking", arr2);
- if (FLAGS_test_cancel_global_check) HeapLeakChecker::CancelGlobalCheck();
+ if (FLAGS_test_cancel_global_check) {
+ HeapLeakChecker::CancelGlobalCheck();
+ } else {
+ // Verify we can call NoGlobalLeaks repeatedly without deadlocking
+ HeapLeakChecker::NoGlobalLeaks();
+ HeapLeakChecker::NoGlobalLeaks();
+ }
return Pass();
// whole-program leak-check should (with very high probability)
// catch the leak of arr1 and arr2 (4 * sizeof(void*) bytes)