Changeset 1126 in webkit for trunk/JavaScriptCore/kjs/value.h
- Timestamp:
- May 10, 2002, 9:41:01 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/value.h
r1024 r1126 95 95 virtual ~ValueImp(); 96 96 97 #ifdef APPLE_CHANGES 98 // The collecter lock is not locked around the ref() and unref() 99 // methods for the following reasons: 100 // 101 // - The only cases where chaging the refcount could possibly 102 // affect the collector's behavior is incrementing from 0 to 1, 103 // and decrementing from 1 to 0. 104 // 105 // - In the 0 to 1 case, the GC allowed flag will always be off 106 // beforehand, and set right afterwards. And setting it grabs the 107 // collector lock. So if this happens in the middle of GC, the 108 // collector will see either a refcount 0 GC not allowed object, 109 // or a refcount 1 GC not allowed object, and these cases are 110 // treated exactly the same. 111 // 112 // - In the 1 to 0 case, the only possible bad effect is that the 113 // object will live for one GC cycle longer than it should have 114 // to, which is really not so bad. 115 // 116 // - In theory on some platforms increment or decrement could make 117 // other threads see intermediate values that are different from 118 // both the start and end value. If that turns out to really be 119 // the case we will have to reconsider this scheme. 120 #endif 97 121 inline ValueImp* ref() { refcount++; return this; } 98 122 inline bool deref() { return (!--refcount); }
Note:
See TracChangeset
for help on using the changeset viewer.