Re: The joy of garbage collection
- From: mschaef@xxxxxxxxxxxx (MSCHAEF.COM)
- Date: Thu, 29 Sep 2005 14:35:12 -0500
In article <1128008720.683586.58350@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
robbie.carlton@xxxxxxxxx <robbie.carlton@xxxxxxxxx> wrote:
...
>Does the program have to maintain a list of free
>memory somewhere,
Yes.
>and if so, how?
SIOD does it with a linked list of cells on the heap.
allocate = remove a cell from the freelist, set its type tag appropriately
mark = traverse the heap, setting a mark bit
sweep = scan the heap. Every unmarked cell that has a type tag
other than TC_FREE_CELL needs to be added to the free list and
have its type tag set to TC_FREE_CELL.
The heap itself is an array or arrays of a C union.
There are a number of significant downsides to the approach, but its
simple to read/maintain.
-Mike
--
http://www.mschaef.com
.
- References:
- The joy of garbage collection
- From: robbie.carlton@xxxxxxxxx
- The joy of garbage collection
- Prev by Date: Re: Where to look for the API documentation?
- Next by Date: Re: The joy of garbage collection
- Previous by thread: Re: The joy of garbage collection
- Next by thread: lisp function questions
- Index(es):
Relevant Pages
|