Content deleted Content added
Refined the algorithm example: |
Fix a bug in the example implementation of the algorithm where `fromspace` was wrongly assigned to `allocPtr` and `scanPtr` in collect(). It should be `tospace` (after swapping) where `allocPtr` and `scanPtr` start at. |
||
Line 43:
collect() =
swap(fromspace, tospace)
allocPtr =
scanPtr =
-- scan every root you've got
Line 51:
EndForEach
-- scan objects in the
While scanPtr < allocPtr
ForEach reference r from o (pointed to by scanPtr)
r = copy(r)
EndForEach
scanPtr = scanPtr + o.size() -- points to the next object in the
EndWhile
</pre>
|