From: Stephen Adams Date: Mon, 24 Apr 1995 23:22:30 +0000 (+0000) Subject: Added SET-GC-NOTIFICATION! X-Git-Tag: 20090517-FFI~6395 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=02a23cd5d9f46c637fe832e874e9cc40ac50c3b4;p=mit-scheme.git Added SET-GC-NOTIFICATION! --- diff --git a/v7/src/runtime/gcnote.scm b/v7/src/runtime/gcnote.scm index 667f47f2d..7cdac9d5a 100644 --- a/v7/src/runtime/gcnote.scm +++ b/v7/src/runtime/gcnote.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: gcnote.scm,v 14.10 1993/10/21 11:49:44 cph Exp $ +$Id: gcnote.scm,v 14.11 1995/04/24 23:22:19 adams Exp $ Copyright (c) 1988-93 Massachusetts Institute of Technology @@ -45,6 +45,18 @@ MIT in each case. |# (else (error "Can't grab GC statistics hook"))))) unspecific) +(define (set-gc-notification! #!optional on?) + (let ((on? (if (default-object? on?) #T on?))) + (set! hook/record-statistic! + (let ((current hook/record-statistic!)) + (if (or (eq? current gc-notification) + (eq? current default/record-statistic!)) + (if on? + gc-notification + default/record-statistic!) + (error "Can't grab GC statistics hook")))) + unspecific)) + (define (with-gc-notification! notify? thunk) (fluid-let ((hook/record-statistic! (if notify? gc-notification default/record-statistic!))) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index a48e77d7b..8f9355c10 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.254 1995/04/23 05:43:50 cph Exp $ +$Id: runtime.pkg,v 14.255 1995/04/24 23:22:30 adams Exp $ Copyright (c) 1988-95 Massachusetts Institute of Technology @@ -762,6 +762,7 @@ MIT in each case. |# (export () gc-statistic->string print-gc-statistics + set-gc-notification! toggle-gc-notification! with-gc-notification!)) diff --git a/v8/src/runtime/runtime.pkg b/v8/src/runtime/runtime.pkg index a48e77d7b..8f9355c10 100644 --- a/v8/src/runtime/runtime.pkg +++ b/v8/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.254 1995/04/23 05:43:50 cph Exp $ +$Id: runtime.pkg,v 14.255 1995/04/24 23:22:30 adams Exp $ Copyright (c) 1988-95 Massachusetts Institute of Technology @@ -762,6 +762,7 @@ MIT in each case. |# (export () gc-statistic->string print-gc-statistics + set-gc-notification! toggle-gc-notification! with-gc-notification!))