December 01, 1997
C++ and Garbage Collection
C++ and Garbage CollectionBy Mike SpertusDr. Dobb's Journal December 1997
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 */
Example 2: Selecting the appropriate mark bit.
Copyright © 1997, Dr. Dobb's Journal
|
|
|||||||||||||||||
|
|