diff options
author | telsoa01 <telmo.soares@arm.com> | 2018-08-31 09:22:23 +0100 |
---|---|---|
committer | telsoa01 <telmo.soares@arm.com> | 2018-08-31 09:22:23 +0100 |
commit | c577f2c6a3b4ddb6ba87a882723c53a248afbeba (patch) | |
tree | bd7d4c148df27f8be6649d313efb24f536b7cf34 /src/armnnUtils/LeakChecking.cpp | |
parent | 4c7098bfeab1ffe1cdc77f6c15548d3e73274746 (diff) | |
download | armnn-c577f2c6a3b4ddb6ba87a882723c53a248afbeba.tar.gz |
Release 18.08
Diffstat (limited to 'src/armnnUtils/LeakChecking.cpp')
-rw-r--r-- | src/armnnUtils/LeakChecking.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/armnnUtils/LeakChecking.cpp b/src/armnnUtils/LeakChecking.cpp index ac12fe01de..83aa5d8ceb 100644 --- a/src/armnnUtils/LeakChecking.cpp +++ b/src/armnnUtils/LeakChecking.cpp @@ -8,6 +8,9 @@ #include "LeakChecking.hpp" #include "gperftools/heap-checker.h" +namespace armnnUtils +{ + struct ScopedLeakChecker::Impl { HeapLeakChecker m_LeakChecker; @@ -59,4 +62,20 @@ ScopedDisableLeakChecking::~ScopedDisableLeakChecking() { } +void LocalLeakCheckingOnly() +{ + auto * globalChecker = HeapLeakChecker::GlobalChecker(); + if (globalChecker) + { + // Don't care about global leaks and make sure we won't report any. + // This is because leak checking supposed to run in well defined + // contexts through the ScopedLeakChecker, otherwise we risk false + // positives because of external factors. + globalChecker->NoGlobalLeaks(); + globalChecker->CancelGlobalCheck(); + } +} + +} // namespace armnnUtils + #endif // ARMNN_LEAK_CHECKING_ENABLED |