Changeset 1791 in webkit for trunk/JavaScriptCore/kjs/value.h
- Timestamp:
- Aug 9, 2002, 9:31:50 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/value.h
r1326 r1791 95 95 virtual ~ValueImp(); 96 96 97 #ifdef APPLE_CHANGES98 // The collector lock is not locked around the ref() and unref()99 // methods for the following reasons:100 //101 // - The only cases where changing the refcount could possibly102 // 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 off106 // beforehand, and set right afterwards. And setting it grabs the107 // collector lock. So if this happens in the middle of GC, the108 // collector will see either a refcount 0 GC not allowed object,109 // or a refcount 1 GC not allowed object, and these cases are110 // treated exactly the same.111 //112 // - In the 1 to 0 case, the only possible bad effect is that the113 // object will live for one GC cycle longer than it should have114 // to, which is really not so bad.115 //116 // - In theory on some platforms increment or decrement could make117 // other threads see intermediate values that are different from118 // both the start and end value. If that turns out to really be119 // the case we will have to reconsider this scheme.120 #endif121 97 inline ValueImp* ref() { refcount++; return this; } 122 98 inline bool deref() { return (!--refcount); }
Note:
See TracChangeset
for help on using the changeset viewer.