forget
a word, the old compiled block will be reclaimed.Code GC will use the mark and sweep algorithm, without moving the code blocks around, in contrast to the generational copying GC used for data. The reason code cannot be moved around reliably is callbacks -- C code may hold on to pointers to Factor code. The heap will be compacted when the image is saved.
Of course if a callback refers to a word which has been GC'd, your program will crash if it attempts to invoke the callback. The solution is "don't do it, then" -- if a callback is actively held on to by C code, the consequences of
forget
ing or redefining it are undefined.
No comments:
Post a Comment