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 19 matching lines...) Expand all Loading... |
30 #if !ENABLE(ASSERT) | 30 #if !ENABLE(ASSERT) |
31 | 31 |
32 RefCountedLeakCounter::RefCountedLeakCounter(const char*) { } | 32 RefCountedLeakCounter::RefCountedLeakCounter(const char*) { } |
33 RefCountedLeakCounter::~RefCountedLeakCounter() { } | 33 RefCountedLeakCounter::~RefCountedLeakCounter() { } |
34 | 34 |
35 void RefCountedLeakCounter::increment() { } | 35 void RefCountedLeakCounter::increment() { } |
36 void RefCountedLeakCounter::decrement() { } | 36 void RefCountedLeakCounter::decrement() { } |
37 | 37 |
38 #else | 38 #else |
39 | 39 |
40 #define LOG_CHANNEL_PREFIX Log | |
41 static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn }; | |
42 | |
43 RefCountedLeakCounter::RefCountedLeakCounter(const char* description) | 40 RefCountedLeakCounter::RefCountedLeakCounter(const char* description) |
44 : m_description(description) | 41 : m_description(description) |
45 { | 42 { |
46 } | 43 } |
47 | 44 |
48 RefCountedLeakCounter::~RefCountedLeakCounter() | 45 RefCountedLeakCounter::~RefCountedLeakCounter() |
49 { | 46 { |
50 if (!m_count) | 47 if (!m_count) |
51 return; | 48 return; |
52 | 49 |
53 WTF_LOG(RefCountedLeaks, "LEAK: %u %s", m_count, m_description); | 50 VLOG(0) << "LEAK: " << m_count << " " << m_description; |
54 } | 51 } |
55 | 52 |
56 void RefCountedLeakCounter::increment() | 53 void RefCountedLeakCounter::increment() |
57 { | 54 { |
58 atomicIncrement(&m_count); | 55 atomicIncrement(&m_count); |
59 } | 56 } |
60 | 57 |
61 void RefCountedLeakCounter::decrement() | 58 void RefCountedLeakCounter::decrement() |
62 { | 59 { |
63 atomicDecrement(&m_count); | 60 atomicDecrement(&m_count); |
64 } | 61 } |
65 | 62 |
66 #endif | 63 #endif |
67 | 64 |
68 } // namespace WTF | 65 } // namespace WTF |
OLD | NEW |