C++ and Garbage Collection 
by Mike Spertus


Listing One
if(word > heapBottom && word < heapTop) { /* In heap? */
   desc = blockDescriptors[word >> 12])   /* Get descriptor */
   desc->marked = 1;                      /* Mark the block */
   if(desc->kind == SMALL_OBJECT_PAGE)    /* small object array? */
       desc->markbits[(word - desc->objBase)/desc->objsize] = 1;
}                                          /* Mark individual item */

Listing Two
#include <setjmp.h>
jmp_buf j;
void saveRegisters()
{
    setjmp(&j);
}



1


