| Allegro CL version 8.2 Unrevised from 8.1 to 8.2. 8.1 version |
If the gsgc switch :hook-after-gc
is
true, then the value of this symbol, if
true, will be funcall'ed immediately after a scavenge.
Thus the value should be a function that takes five arguments:
Note 1: Efficiency is the ratio of non-gc cpu time to total cpu time.
Note 2: Garbage collections usually happen because an object must be allocated but there is not enough free space to do so. The fifth argument gives the size of not-yet-allocated objects.
The initial value of this variable is a function that implements
the global gc behavior described in Global garbage collection in
gc.htm and in the description of *global-gc-behavior*
. The
function is named by the internal symbol
excl::default-gc-after-hook
. If you wish to change
the value of this variable and preserve the global gc behavior
described below, set the value of this switch to something like the
following (note the use of a feature to prevent recursion if this code
is run twice):
;; This form should be placed in a location (such as a file) ;; where it can be compiled. ;; The inital value of excl:*gc-after-hook* is a function named by ;; the symbol excl::default-gc-after-hook but we bind the value ;; to allow for an already modified function whose behavior ;; is being preserved. (let ((continuation excl:*gc-after-hook*)) (if (null (excl:featurep :my-gc-after-hook-added)) (progn (push :my-gc-after-hook-added *features*) (setq excl:*gc-after-hook* #'(lambda (global new old efficiency to-be-allocated) ; ... code to do what you want after a gc .... (when continuation (funcall continuation global new old efficiency to-be-allocated)) ; ... more of your code if desired ) ))))
See also gc.htm for general information on garbage collection Allegro CL, including information on gsgc switches and parameters. See section Global garbage collection in that document for information on global garbage collection.
Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.
| Allegro CL version 8.2 Unrevised from 8.1 to 8.2. 8.1 version |