Cheney's algorithm: Difference between revisions

Content deleted Content added
No edit summary
Line 21:
<pre>
initialize() =
tospace = 0N/2
fromspace = N/20
allocPtr = tospacefromspace
scanPtr = whatever -- only used during collection
</pre>
Line 29:
<pre>
allocate(n) =
If allocPtr + n > tospace fromspace+ N/2
collect()
EndIf
If allocPtr + n > tospace fromspace+ N/2
fail “insufficient memory”
EndIf