Changes between Version 1 and Version 2 of GCSweepFreeImplementation
- Timestamp:
- 05/10/10 22:58:08 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GCSweepFreeImplementation
v1 v2 24 24 During the mark phase, we append every live GCable to the LIVE list, if it's in the MAYBE list. (We'll have to manage the existing flags carefully to avoid adding and re-adding; perhaps some toggle will help. "Last time, 0 meant live. This time, 1 means live.") 25 25 26 By the end of the mark phase, all live GCables should be in the LIVE list. Everything in the MAYBE list should now be DEAD, so we can append it to that list. We can walk the MAYBElist and perform any custom destruction then.26 By the end of the mark phase, all live GCables should be in the LIVE list. Everything in the MAYBE list should now be DEAD, so we can append it to that list. We can walk the DEAD list and perform any custom destruction then. 27 27 28 28 The benefit to this system is that the O(n) operation of the sweep (which tends to hew to the full extent of n) of sweeping becomes much more efficient. The cost of allocating an object is slightly higher due to the need to manipulate pointers in the linked lists, but the cost of freeing dead objects is much cheaper.