Changes between Version 2 and Version 3 of CopyingGarbageCollector
- Timestamp:
- 01/03/10 01:05:04 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CopyingGarbageCollector
v2 v3 1 Copying Garbage Collector 1 '''Copying Garbage Collector''' 2 2 3 3 (see TT #616) 4 4 5 The basic concept of a Copying Collector is that the heap is d evided into two5 The basic concept of a Copying Collector is that the heap is divided into two 6 6 equal semi-spaces, one of which contains the current data and the other 7 7 obsolete data. The Garbage Collection phase starts by flipping the roles of … … 60 60 free = free + n 61 61 temp = P[0] -- field 0 will hold the forwarding address 62 forwardingaddress [P]= P'62 forwardingaddress(P) = P' 63 63 P'[0] = copy(temp) 64 64 for i = 1 to n-1 -- copy each field of P into P' … … 93 93 generally it can be written over the first word in the cell provided that the 94 94 original value of the cell is saved beforehand. In the above it is assumed 95 that the forwarding address field in cell P is p[0], and forwarding address(P)95 that the forwarding address field in cell P is P[0], and forwarding address(P) 96 96 and P[0] are used interchangeably. 97 97
