Changeset 34760 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- Jun 24, 2008, 2:51:07 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r34754 r34760 43 43 #include <wtf/HashSet.h> 44 44 #include <wtf/MathExtras.h> 45 #include <wtf/Threading.h> 45 46 46 47 namespace KJS { … … 60 61 61 62 struct ParserRefCountedCounter { 62 static unsigned count; 63 ParserRefCountedCounter() 63 ~ParserRefCountedCounter() 64 64 { 65 65 if (count) 66 66 LOG(KJSNodeLeaks, "LEAK: %u KJS::Node\n", count); 67 67 } 68 69 static void increment(); 70 static void decrement(); 71 72 private: 73 static volatile int count; 68 74 }; 69 unsigned ParserRefCountedCounter::count = 0; 75 76 volatile int ParserRefCountedCounter::count = 0; 77 78 #if USE(MULTIPLE_THREADS) 79 void ParserRefCountedCounter::increment() 80 { 81 atomicIncrement(&count); 82 } 83 84 void ParserRefCountedCounter::decrement() 85 { 86 atomicDecrement(&count); 87 } 88 89 #else 90 91 void ParserRefCountedCounter::increment() 92 { 93 ++count; 94 } 95 96 void ParserRefCountedCounter::decrement() 97 { 98 --count; 99 } 100 #endif 101 70 102 static ParserRefCountedCounter parserRefCountedCounter; 103 71 104 #endif 72 105 … … 77 110 { 78 111 #ifndef NDEBUG 79 ++ParserRefCountedCounter::count;112 ParserRefCountedCounter::increment(); 80 113 #endif 81 114 if (!newTrackedObjects) … … 88 121 { 89 122 #ifndef NDEBUG 90 --ParserRefCountedCounter::count;123 ParserRefCountedCounter::decrement(); 91 124 #endif 92 125 }
Note:
See TracChangeset
for help on using the changeset viewer.