From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/_leak_checking_8cpp_source.xhtml | 115 +++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 21.02/_leak_checking_8cpp_source.xhtml (limited to '21.02/_leak_checking_8cpp_source.xhtml') diff --git a/21.02/_leak_checking_8cpp_source.xhtml b/21.02/_leak_checking_8cpp_source.xhtml new file mode 100644 index 0000000000..38b75da781 --- /dev/null +++ b/21.02/_leak_checking_8cpp_source.xhtml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + +ArmNN: src/armnnUtils/LeakChecking.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
LeakChecking.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #ifdef ARMNN_LEAK_CHECKING_ENABLED
7 
8 #include "LeakChecking.hpp"
9 #include "gperftools/heap-checker.h"
10 
11 namespace armnnUtils
12 {
13 
14 struct ScopedLeakChecker::Impl
15 {
16  HeapLeakChecker m_LeakChecker;
17 
18  Impl(const std::string & name)
19  : m_LeakChecker(name.c_str())
20  {
21  }
22 };
23 
24 ScopedLeakChecker::ScopedLeakChecker(const std::string & name)
25 : m_Impl(new Impl(name))
26 {
27 }
28 
29 ScopedLeakChecker::~ScopedLeakChecker() {}
30 
31 bool ScopedLeakChecker::IsActive()
32 {
33  return HeapLeakChecker::IsActive();
34 }
35 
36 bool ScopedLeakChecker::NoLeaks()
37 {
38  return (IsActive() ? m_Impl->m_LeakChecker.NoLeaks() : true);
39 }
40 
41 ssize_t ScopedLeakChecker::BytesLeaked() const
42 {
43  return (IsActive() ? m_Impl->m_LeakChecker.BytesLeaked(): 0);
44 }
45 
46 ssize_t ScopedLeakChecker::ObjectsLeaked() const
47 {
48  return (IsActive() ? m_Impl->m_LeakChecker.ObjectsLeaked(): 0 );
49 }
50 
51 struct ScopedDisableLeakChecking::Impl
52 {
53  HeapLeakChecker::Disabler m_Disabler;
54 };
55 
56 ScopedDisableLeakChecking::ScopedDisableLeakChecking()
57 : m_Impl(new Impl)
58 {
59 }
60 
61 ScopedDisableLeakChecking::~ScopedDisableLeakChecking()
62 {
63 }
64 
65 void LocalLeakCheckingOnly()
66 {
67  auto * globalChecker = HeapLeakChecker::GlobalChecker();
68  if (globalChecker)
69  {
70  // Don't care about global leaks and make sure we won't report any.
71  // This is because leak checking supposed to run in well defined
72  // contexts through the ScopedLeakChecker, otherwise we risk false
73  // positives because of external factors.
74  globalChecker->NoGlobalLeaks();
75  globalChecker->CancelGlobalCheck();
76  }
77 }
78 
79 } // namespace armnnUtils
80 
81 #endif // ARMNN_LEAK_CHECKING_ENABLED
+ +
+
+ + + + -- cgit v1.2.1