Skip to content
Snippets Groups Projects
Commit cc3f78d5 authored by wlott's avatar wlott
Browse files

Instead of using os_zero to zero the control stack, fill it with zeros

ourselves.
parent 70e3f5a3
No related branches found
No related tags found
No related merge requests found
/* /*
* Stop and Copy GC based on Cheney's algorithm. * 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. * Written by Christopher Hoover.
*/ */
...@@ -132,6 +132,27 @@ struct timeval *x, *y; ...@@ -132,6 +132,27 @@ struct timeval *x, *y;
((double) y->tv_sec + (double) y->tv_usec * 1.0e-6)); ((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() collect_garbage()
{ {
#ifdef PRINTNOISE #ifdef PRINTNOISE
...@@ -268,9 +289,7 @@ collect_garbage() ...@@ -268,9 +289,7 @@ collect_garbage()
#ifdef PRINTNOISE #ifdef PRINTNOISE
printf("Zeroing empty part of control stack ...\n"); printf("Zeroing empty part of control stack ...\n");
#endif #endif
os_zero((os_vm_address_t) current_control_stack_pointer, zero_stack();
(os_vm_size_t) (CONTROL_STACK_SIZE -
control_stack_size * sizeof(lispobj)));
(void) sigsetmask(oldmask); (void) sigsetmask(oldmask);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment