This assignment is not for credit, but if you’re interested enough in garbage collection to try it, the instructor will be happy to provide feedback.

Add garbage collection to your msdscript implementation as shown in the videos and slides.

Some notes and tips:

 

void GCable::reset() {
  heap_size = (8*1024);
  to_space = nullptr;
  from_space = nullptr;
  allocation_offset = 0;
  out_of_memory = false;

  Env::empty = NEW(EmptyEnv)();
  Cont::done = NEW(DoneCont)();
}