[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue GC-MESSAGES (Version 2)
Issue: GC-MESSAGES
References: None
Category: ENHANCEMENT
Edit history: 23-Apr-87, Version 1 by Pitman
14-Nov-88, Version 2 by Pitman
Status: For Internal Discussion
Problem Description:
Although there is no standard interface to the garbage collector,
it is common for there to be a garbage collector in nearly every system.
In many systems, these do unsolicited typeout which obstructs program
typeout in unpredictable ways.
Application programs which do display (especially display which conses)
need a way of deferring GC warnings that might ruin the display.
Proposal (GC-MESSAGES:NEW-MACRO)
Introduce a new macro WITH-GC-STATUS, described as follows:
WITH-GC-STATUS (&key VERBOSE) &body forms
Executes the body FORMS sequentially, as if by PROGN, returning the
value(s) of the last form (or NIL if there were no FORMS).
If :VERBOSE T is specified in the options list, the implementation
is encouraged to provide some notice of any GC activity that occurs
during the execution of the FORMS.
If :VERBOSE NIL is specified in the options list, the implementation
is discouraged from providing any notice of any GC activity that
occurs during the execution of FORMS.
If :VERBOSE :DEFAULT is specified (or if a :VERBOSE option is
not supplied), then the implementation is neither encouraged nor
discouraged from providing notice about any GC activity that occurs
during the execution of FORMS.
Implementations are permitted to extend this form to provide other,
implementation-specific, GC-related keyword options.
If :ALLOW-OTHER-KEYS T is specified, any unrecognized options will
be ignored. For example,
(WITH-GC-STATUS (:VERBOSE NIL
:ACME-GC-OPTION-17 T
:ALLOW-OTHER-KEYS T)
...)
might select GC Option #17 in ACME Common Lisp, but in other Common
Lisp implementations (where that option presumably would not exist),
the keyword would be ignored.
If :ALLOW-OTHER-KEYS NIL is specified (or if the :ALLOW-OTHER-KEYS
option is not supplied), then an error will be signalled if the
implementation does not recognize all options in the options list.
Rationale:
This facility addresses the stated problem in a straightforward way.
Current Practice:
This functionality is provided in some form or another by a number of
implementations.
Zetalisp currently offers SI:GC-REPORT-STREAM which can be set to T, NIL,
or a stream. It provides useful flexibility and is used by quite a number
of users.
Other systems provide ways of enabling or disabling the messages, or of
customizing the message which is typed out.
Adoption Cost:
The set of places in which the GC does typeout is probably very
restricted, so finding them and changing them to be appropriately
conditionalized is probably not a lot of work.
Benefits:
This would allow the user some portable control over a common feature which
cannot currently be controlled in a portable way.
Conversion Cost:
This is an upward compatible change.
Aesthetics:
No significant impact.
Discussion:
MACSYMA needs this (so it can bind it to NIL). Its display often does
consing. In some implementations this can cause a GC, which can in turn
spoil the carefully crafted display.
Version 1 of this proposal did not fly because it proposed a variable to
control the behavior, and some people were not convinced that a simple
variable would be powerful enough in all cases -- some feared a function
call might be needed to toggle the state. This rewrite addresses those
concerns.
Pitman supports this proposal.