We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Mark

TODO: Would it be funny to just have a video clip of me going "MAAARRKKKK" and that's it?

I'd advise against it.

In some mark and sweep implementations you'll see different ways to mark "root objects" – the objects directly referenced by stack frames. However, in our simplistic VM it's a bit easier to find and mark all of the directly referenced objects. You'll see why when you write it in a moment.

Assignment

Complete the mark function in vm.c. It should set every object that's directly referenced by a stack frame to is_marked = true.