Changes between Version 2 and Version 3 of CopyingGarbageCollector

Show
Ignore:
Timestamp:
01/03/10 01:05:04 (4 years ago)
Author:
mikehh
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CopyingGarbageCollector

    v2 v3  
    1 Copying Garbage Collector 
     1'''Copying Garbage Collector''' 
    22 
    33(see TT #616) 
    44 
    5 The basic concept of a Copying Collector is that the heap is devided into two 
     5The basic concept of a Copying Collector is that the heap is divided into two 
    66equal semi-spaces, one of which contains the current data and the other 
    77obsolete data.  The Garbage Collection phase starts by flipping the roles of 
     
    6060        free = free + n 
    6161        temp = P[0]                 -- field 0 will hold the forwarding address 
    62         forwardingaddress[P] = P' 
     62        forwardingaddress(P) = P' 
    6363        P'[0] = copy(temp) 
    6464        for i = 1 to n-1            -- copy each field of P into P' 
     
    9393generally it can be written over the first word in the cell provided that the 
    9494original 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) 
     95that the forwarding address field in cell P is P[0], and forwarding address(P) 
    9696and P[0] are used interchangeably. 
    9797