GC is here
Frode Vatvedt Fjeld <[email protected]> Mon, 29 Mar 2004 17:18:33 +0200
| Newsgroups | gmane.lisp.movitz.devel |
|---|---|
| Message-ID | <[email protected]> |
Since my latest check-ins, there is some basic GC support in Movitz, and included in the los0 image. There's a new file losp/muerte/scavenge.lisp that so far holds two functions. One maps a function over potential pointers in any heap area, while another maps similarly over a stack, starting "inside" and winding out. This is the way a stack must be scavenged in order to see what is code-vectors (from the call/ret assembly), and what are pointers. Conspicuously missing still is support for code-vectors to migrate in any way. There's another file losp/los0-gc.lisp, that implements the GC architecture that los0.img now uses. The central function here is stop-and-copy, which performs Cheney style copying GC. There is much room for improvement here both in terms of functionality and performance, but I think this here is a decent basis for further development, and to be able to check the "supports GC" feature column. One nice way to see all this in action, is to boot up los0.img (with bochs, unless you're lucky to have a PC with an ancient NE2000 NIC around) and start (ip4-test :10.0.0.10) and ping it. Ip4-test conses a new array for each ethernet frame it receives, so pretty soon you should be able to see the effects of the GC. (Of course, substitute 10.0.0.10 with some IPv4 address suitable for your LAN.) The GC incurs about 4.5 seconds delay under Bochs for me, while it's in the noise on real hardware with a 466MHz CPU. -- Frode Vatvedt Fjeld