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

Wrapped #ifdef PRINTNOISE around all the printfs. Wrote a ptrans_symbol

instead of just using ptrans_boxed so that we can pass on scavenging things
like the package.
parent 12cbe827
No related branches found
No related tags found
No related merge requests found
/* Purify. */ /* Purify. */
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/purify.c,v 1.2 1990/07/02 05:21:04 wlott Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/purify.c,v 1.3 1990/07/18 10:57:55 wlott Exp $ */
#include <mach.h> #include <mach.h>
...@@ -67,6 +67,31 @@ static lispobj ptrans_boxed(thing, header) ...@@ -67,6 +67,31 @@ static lispobj ptrans_boxed(thing, header)
return result; return result;
} }
static lispobj ptrans_symbol(thing, header)
{
int nwords;
lispobj result, *new, *old;
nwords = 1 + HeaderValue(header);
/* Allocate it */
old = (lispobj *)PTR(thing);
new = static_free;
static_free += CEILING(nwords, 2);
/* Copy it. */
bcopy(old, new, nwords * sizeof(lispobj));
/* Deposit forwarding pointer. */
result = (lispobj)new | LowtagOf(thing);
*old = result;
/* Scavenge it. */
pscav(&((struct symbol *)new)->function, 1);
return result;
}
static lispobj ptrans_unboxed(thing, header) static lispobj ptrans_unboxed(thing, header)
{ {
int nwords; int nwords;
...@@ -281,10 +306,12 @@ static lispobj ptrans_otherptr(thing, header) ...@@ -281,10 +306,12 @@ static lispobj ptrans_otherptr(thing, header)
case type_ComplexArray: case type_ComplexArray:
case type_ClosureHeader: case type_ClosureHeader:
case type_ValueCellHeader: case type_ValueCellHeader:
case type_SymbolHeader:
case type_WeakPointer: case type_WeakPointer:
return ptrans_boxed(thing, header); return ptrans_boxed(thing, header);
case type_SymbolHeader:
return ptrans_symbol(thing, header);
case type_SimpleString: case type_SimpleString:
return ptrans_vector(thing, 8, 1, FALSE); return ptrans_vector(thing, 8, 1, FALSE);
...@@ -491,11 +518,14 @@ lispobj roots; ...@@ -491,11 +518,14 @@ lispobj roots;
{ {
lispobj *clean; lispobj *clean;
#ifdef PRINTNOISE
printf("[Doing purification:"); printf("[Doing purification:");
fflush(stdout); fflush(stdout);
#endif
if (FIXNUM_TO_INT(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX)) != 0) { if (FIXNUM_TO_INT(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX)) != 0) {
printf(" Ack! Can't purify interrupt contexts.]\n"); printf(" Ack! Can't purify interrupt contexts. ");
fflush(stdout);
return; return;
} }
...@@ -504,31 +534,43 @@ lispobj roots; ...@@ -504,31 +534,43 @@ lispobj roots;
static_end = static_free = static_end = static_free =
(lispobj *)SymbolValue(STATIC_SPACE_FREE_POINTER); (lispobj *)SymbolValue(STATIC_SPACE_FREE_POINTER);
#ifdef PRINTNOISE
printf(" roots"); printf(" roots");
fflush(stdout); fflush(stdout);
#endif
pscav(&roots, 1); pscav(&roots, 1);
#ifdef PRINTNOISE
printf(" handlers"); printf(" handlers");
fflush(stdout); fflush(stdout);
#endif
pscav((lispobj *) interrupt_handlers, pscav((lispobj *) interrupt_handlers,
sizeof(interrupt_handlers) / sizeof(lispobj)); sizeof(interrupt_handlers) / sizeof(lispobj));
#ifdef PRINTNOISE
printf(" stack"); printf(" stack");
fflush(stdout); fflush(stdout);
#endif
pscav(control_stack, current_control_stack_pointer - control_stack); pscav(control_stack, current_control_stack_pointer - control_stack);
#ifdef PRINTNOISE
printf(" bindings"); printf(" bindings");
fflush(stdout); fflush(stdout);
#endif
pscav(binding_stack, current_binding_stack_pointer - binding_stack); pscav(binding_stack, current_binding_stack_pointer - binding_stack);
#ifdef PRINTNOISE
printf(" static"); printf(" static");
fflush(stdout); fflush(stdout);
#endif
clean = static_space; clean = static_space;
while (clean != static_free) while (clean != static_free)
clean = pscav(clean, static_free - clean); clean = pscav(clean, static_free - clean);
#ifdef PRINTNOISE
printf(" cleanup"); printf(" cleanup");
fflush(stdout); fflush(stdout);
#endif
os_zero((os_vm_address_t) current_dynamic_space, os_zero((os_vm_address_t) current_dynamic_space,
(os_vm_size_t) DYNAMIC_SPACE_SIZE); (os_vm_size_t) DYNAMIC_SPACE_SIZE);
...@@ -542,8 +584,10 @@ lispobj roots; ...@@ -542,8 +584,10 @@ lispobj roots;
SetSymbolValue(READ_ONLY_SPACE_FREE_POINTER, (lispobj)read_only_free); SetSymbolValue(READ_ONLY_SPACE_FREE_POINTER, (lispobj)read_only_free);
SetSymbolValue(STATIC_SPACE_FREE_POINTER, (lispobj)static_free); SetSymbolValue(STATIC_SPACE_FREE_POINTER, (lispobj)static_free);
#ifdef PRINTNOISE
printf(" Done.]\n"); printf(" Done.]\n");
fflush(stdout); fflush(stdout);
#endif
return 0; return 0;
} }
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