teaching machines

CS 330 Lecture 29 – Garbage Collection

April 16, 2012 by . Filed under cs330, lectures, spring 2012.

Agenda

TODO

Mark-and-sweep

for each allocated block:
  mark unvisited

for each pointer on stack:
  mark block pointed to visited
  recurse on any pointers in block

for each allocated block:
  free if block unvisited

Code

Haiku

Grades would be easy.
But you all have vtables.
You are dynamic.