From cc3f78d5abb007d8ec7c9b726747f391ec608ff3 Mon Sep 17 00:00:00 2001 From: wlott <wlott> Date: Mon, 2 Mar 1992 03:56:01 +0000 Subject: [PATCH] Instead of using os_zero to zero the control stack, fill it with zeros ourselves. --- ldb/gc.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/ldb/gc.c b/ldb/gc.c index 4a92c5ebe..a3f0820ae 100644 --- a/ldb/gc.c +++ b/ldb/gc.c @@ -1,7 +1,7 @@ /* * Stop and Copy GC based on Cheney's algorithm. * - * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/gc.c,v 1.31 1991/11/10 22:32:46 wlott Exp $ + * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/gc.c,v 1.32 1992/03/02 03:56:01 wlott Exp $ * * Written by Christopher Hoover. */ @@ -132,6 +132,27 @@ struct timeval *x, *y; ((double) y->tv_sec + (double) y->tv_usec * 1.0e-6)); } +#define BYTES_ZERO_BEFORE_END (1<<12) + +static void zero_stack() +{ + unsigned long *ptr = (unsigned long *)current_control_stack_pointer; + + search: + do { + if (*ptr) + goto fill; + ptr++; + } while (((unsigned long)ptr) & (BYTES_ZERO_BEFORE_END-1)); + return; + + fill: + do { + *ptr++ = 0; + } while (((unsigned long)ptr) & (BYTES_ZERO_BEFORE_END-1)); + goto search; +} + collect_garbage() { #ifdef PRINTNOISE @@ -268,9 +289,7 @@ collect_garbage() #ifdef PRINTNOISE printf("Zeroing empty part of control stack ...\n"); #endif - os_zero((os_vm_address_t) current_control_stack_pointer, - (os_vm_size_t) (CONTROL_STACK_SIZE - - control_stack_size * sizeof(lispobj))); + zero_stack(); (void) sigsetmask(oldmask); -- GitLab