The project doesn't do anything, so look inside and play with it there. (Sorry.) When the length of the heap minus the length of free is more than the maximum then GC is run. Any object that the stack has a pointer to is marked as reachable. Any object on the heap that isn't reachable has it's pointer added to the free list.
This is handwritten, not generated. Thanks to @joefarebrother for explaining some stuff! OUTDATED -- USE https://scratch.mit.edu/projects/108275890/ INSTEAD