From 02a23cd5d9f46c637fe832e874e9cc40ac50c3b4 Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Mon, 24 Apr 1995 23:22:30 +0000 Subject: [PATCH] Added SET-GC-NOTIFICATION! --- v7/src/runtime/gcnote.scm | 14 +++++++++++++- v7/src/runtime/runtime.pkg | 3 ++- v8/src/runtime/runtime.pkg | 3 ++- 3 files changed, 17 insertions(+), 3 deletions(-) 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!)) -- 2.25.1