OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 void RefCountedLeakCounter::cancelMessageSuppression(const char* reason) | 54 void RefCountedLeakCounter::cancelMessageSuppression(const char* reason) |
55 { | 55 { |
56 ASSERT(leakMessageSuppressionReasons); | 56 ASSERT(leakMessageSuppressionReasons); |
57 ASSERT(leakMessageSuppressionReasons->contains(reason)); | 57 ASSERT(leakMessageSuppressionReasons->contains(reason)); |
58 leakMessageSuppressionReasons->remove(reason); | 58 leakMessageSuppressionReasons->remove(reason); |
59 } | 59 } |
60 | 60 |
61 RefCountedLeakCounter::RefCountedLeakCounter(const char* description) | 61 RefCountedLeakCounter::RefCountedLeakCounter(const char* description) |
62 : m_description(description) | 62 : m_description(description) |
63 { | 63 { |
64 } | 64 } |
65 | 65 |
66 RefCountedLeakCounter::~RefCountedLeakCounter() | 66 RefCountedLeakCounter::~RefCountedLeakCounter() |
67 { | 67 { |
68 static bool loggedSuppressionReason; | 68 static bool loggedSuppressionReason; |
69 if (m_count) { | 69 if (m_count) { |
70 if (!leakMessageSuppressionReasons || leakMessageSuppressionReasons->isE
mpty()) | 70 if (!leakMessageSuppressionReasons || leakMessageSuppressionReasons->isE
mpty()) |
71 LOG(RefCountedLeaks, "LEAK: %u %s", m_count, m_description); | 71 LOG(RefCountedLeaks, "LEAK: %u %s", m_count, m_description); |
72 else if (!loggedSuppressionReason) { | 72 else if (!loggedSuppressionReason) { |
73 // This logs only one reason. Later we could change it so we log all
the reasons. | 73 // This logs only one reason. Later we could change it so we log all
the reasons. |
74 LOG(RefCountedLeaks, "No leak checking done: %s", leakMessageSuppres
sionReasons->begin()->key); | 74 LOG(RefCountedLeaks, "No leak checking done: %s", leakMessageSuppres
sionReasons->begin()->key); |
75 loggedSuppressionReason = true; | 75 loggedSuppressionReason = true; |
76 } | 76 } |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 void RefCountedLeakCounter::increment() | 80 void RefCountedLeakCounter::increment() |
81 { | 81 { |
82 atomicIncrement(&m_count); | 82 atomicIncrement(&m_count); |
83 } | 83 } |
84 | 84 |
85 void RefCountedLeakCounter::decrement() | 85 void RefCountedLeakCounter::decrement() |
86 { | 86 { |
87 atomicDecrement(&m_count); | 87 atomicDecrement(&m_count); |
88 } | 88 } |
89 | 89 |
90 #endif | 90 #endif |
91 | 91 |
92 } // namespace WTF | 92 } // namespace WTF |
OLD | NEW |