fix GC log message use of value-width parameter (which might not be available)

svn: r15309
This commit is contained in:
Matthew Flatt 2009-06-26 19:53:54 +00:00
parent d007777e2a
commit 40f7cdf52a

View File

@ -7400,13 +7400,26 @@ static void done_with_GC()
#ifdef MZ_PRECISE_GC
static void inform_GC(int major_gc, long pre_used, long post_used)
{
if (scheme_main_logger)
scheme_log(scheme_main_logger,
SCHEME_LOG_DEBUG, 0,
if (scheme_main_logger) {
/* Don't use scheme_log(), because it wants to allocate a buffer
based on the max value-print width, and we may not be at a
point where parameters are available. */
char buf[128];
long buflen;
sprintf(buf,
"GC [%s] at %ld bytes; %ld collected in %ld msec",
(major_gc ? "major" : "minor"),
pre_used, pre_used - post_used,
end_this_gc_time - start_this_gc_time);
buflen = strlen(buf);
scheme_log_message(scheme_main_logger,
SCHEME_LOG_DEBUG,
buf, buflen,
NULL);
}
}
#endif