You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MCL had a mechanism for automatically executing user code both before and after a garbage collection via the variables *pre-gc-hook*, *post-gc-hook*, and the functions #'add-gc-hook and #'remove-gc-hook.
CCL no longer seems to support *pre-gc-hook* although it does continue to support *post-gc-hook*. In CCL, adding a function to *pre-gc-hook* (either directly or by calling #'add-gc-hook with an argument of :pre-gc) is effectively a no-op because no current CCL code pays any attention to *pre-gc-hook*.
I don't know for sure why *pre-gc-hook* is no longer supported but I can speculate: Running user code at pre-gc time is asking for trouble because by definition that code runs when the system is out of memory. Supporting *post-gc-hook* on the other hand is easy.
I suspect that *pre-gc-hook* remains in the code only for backward compatibility with MCL.
I propose the following:
We document how *post-gc-hook* works (since it's never been properly documented) and make it clear that there's no longer any such thing as *pre-gc-hook*.
We remove all code that defines and supports *pre-gc-hook* from the code base. I rather doubt there's any old MCL code being run in CCL that depends on it. MCL itself seemed to stop supporting it around version 4.3 or even before. (I say this because a very old MCL example file called #P"edit-callers.lisp" was changed to no longer use *pre-gc-hook* around version 4.3. I don't have complete source code for those old versions so I can't say for sure when that variable stopped being read.)
We remove the file #P"ccl:library;macptr-termination.lisp" because it doesn't get loaded by anybody any more. It seems to be an MCL-specific file. Am I wrong about this?
Comments welcome.
The text was updated successfully, but these errors were encountered:
MCL had a mechanism for automatically executing user code both before and after a garbage collection via the variables
*pre-gc-hook*, *post-gc-hook*
, and the functions#'add-gc-hook
and#'remove-gc-hook
.CCL no longer seems to support
*pre-gc-hook*
although it does continue to support*post-gc-hook*
. In CCL, adding a function to*pre-gc-hook*
(either directly or by calling#'add-gc-hook
with an argument of:pre-gc
) is effectively a no-op because no current CCL code pays any attention to*pre-gc-hook*
.I don't know for sure why
*pre-gc-hook*
is no longer supported but I can speculate: Running user code at pre-gc time is asking for trouble because by definition that code runs when the system is out of memory. Supporting*post-gc-hook*
on the other hand is easy.I suspect that
*pre-gc-hook*
remains in the code only for backward compatibility with MCL.I propose the following:
*post-gc-hook*
works (since it's never been properly documented) and make it clear that there's no longer any such thing as*pre-gc-hook*
.*pre-gc-hook*
from the code base. I rather doubt there's any old MCL code being run in CCL that depends on it. MCL itself seemed to stop supporting it around version 4.3 or even before. (I say this because a very old MCL example file called#P"edit-callers.lisp"
was changed to no longer use*pre-gc-hook*
around version 4.3. I don't have complete source code for those old versions so I can't say for sure when that variable stopped being read.)#P"ccl:library;macptr-termination.lisp"
because it doesn't get loaded by anybody any more. It seems to be an MCL-specific file. Am I wrong about this?Comments welcome.
The text was updated successfully, but these errors were encountered: