implement GC in heap.c