[racket-dev] gc vs assignment

From: Will M. Farr (wmfarr at gmail.com)
Date: Tue Aug 24 11:54:24 EDT 2010

On Aug 24, 2010, at 10:46 AM, Matthias Felleisen wrote:

> (I don't quite understand why there's no extra cost for the second access, but I'll think about it and figure it out.)

If I understand things correctly, the short answer is "fancy hardware."  The page is marked as read-only in the MMU, so a write incurs a page fault.  The page fault is trapped by the GC, which records the page in a table of "written-to pages", marks it read-write in the MMU, and continues the program.  Now, any write to that page is just like a write to anywhere in memory, but the GC knows to scan the page.  This type of thing is only possible with the support in hardware for these sort of read-only page marks.

Do I have it right?


Posted on the dev mailing list.