#define CEILING(x,y) (((x) + ((y) - 1)) & (~((y) - 1)))
\f
-/* Predicates */
+/* predicates */
#if defined(DEBUG_SPACE_PREDICATES)
-boolean from_space_p(lispobj object)
+boolean
+from_space_p(lispobj object)
{
lispobj *ptr;
/* this can be called for untagged pointers as well as for
descriptors, so this assertion's not applicable
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
*/
- ptr = (lispobj *) PTR(object);
+ ptr = (lispobj *) native_pointer(object);
return ((from_space <= ptr) &&
(ptr < from_space_free_pointer));
}
-boolean new_space_p(lispobj object)
+boolean
+new_space_p(lispobj object)
{
lispobj *ptr;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- ptr = (lispobj *) PTR(object);
+ ptr = (lispobj *) native_pointer(object);
return ((new_space <= ptr) &&
(ptr < new_space_free_pointer));
#endif
\f
-/* Copying Objects */
+/* copying objects */
static lispobj
copy_object(lispobj object, int nwords)
lispobj *new;
lispobj *source, *dest;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
gc_assert(from_space_p(object));
gc_assert((nwords & 0x01) == 0);
new_space_free_pointer += nwords;
dest = new;
- source = (lispobj *) PTR(object);
+ source = (lispobj *) native_pointer(object);
#ifdef DEBUG_COPY_VERBOSE
fprintf(stderr,"Copying %d words from %p to %p\n", nwords,source,new);
}
\f
-/* Collect Garbage */
+/* collecting garbage */
#ifdef PRINTNOISE
-static double tv_diff(struct timeval *x, struct timeval *y)
+static double
+tv_diff(struct timeval *x, struct timeval *y)
{
return (((double) x->tv_sec + (double) x->tv_usec * 1.0e-6) -
((double) y->tv_sec + (double) y->tv_usec * 1.0e-6));
#else
#define U32 unsigned long
#endif
-static void zero_stack(void)
+static void
+zero_stack(void)
{
U32 *ptr = (U32 *)current_control_stack_pointer;
search:
#undef U32
-/* this is not generational. It's called with a last_gen arg, which we shun.
- */
-
-void collect_garbage(unsigned ignore)
+/* Note: The generic GC interface we're implementing passes us a
+ * last_generation argument. That's meaningless for us, since we're
+ * not a generational GC. So we ignore it. */
+void
+collect_garbage(unsigned ignore)
{
#ifdef PRINTNOISE
struct timeval start_tv, stop_tv;
/* Set up from space and new space pointers. */
from_space = current_dynamic_space;
-#ifndef ibmrt
from_space_free_pointer = dynamic_space_free_pointer;
-#else
- from_space_free_pointer = (lispobj *)SymbolValue(ALLOCATION_POINTER);
-#endif
+#ifdef PRINTNOISE
fprintf(stderr,"from_space = %lx\n",
(unsigned long) current_dynamic_space);
+#endif
if (current_dynamic_space == (lispobj *) DYNAMIC_0_SPACE_START)
new_space = (lispobj *)DYNAMIC_1_SPACE_START;
else if (current_dynamic_space == (lispobj *) DYNAMIC_1_SPACE_START)
scavenge(((lispobj *)CONTROL_STACK_START), control_stack_size);
-#ifdef ibmrt
- binding_stack_size =
- (lispobj *)SymbolValue(BINDING_STACK_POINTER) - binding_stack;
-#else
binding_stack_size =
current_binding_stack_pointer -
(lispobj *)BINDING_STACK_START;
-#endif
#ifdef PRINTNOISE
printf("Scavenging the binding stack %x - %x (%d words) ...\n",
BINDING_STACK_START,current_binding_stack_pointer,
(os_vm_size_t) DYNAMIC_SPACE_SIZE);
current_dynamic_space = new_space;
-#ifndef ibmrt
dynamic_space_free_pointer = new_space_free_pointer;
-#else
- SetSymbolValue(ALLOCATION_POINTER, (lispobj)new_space_free_pointer);
-#endif
#ifdef PRINTNOISE
size_discarded = (from_space_free_pointer - from_space) * sizeof(lispobj);
}
\f
-/* Scavenging */
-
-#define DIRECT_SCAV 0
+/* scavenging */
static void
scavenge(lispobj *start, u32 nwords)
(unsigned long) start, (unsigned long) object, type);
#endif
-#if DIRECT_SCAV
- words_scavenged = (scavtab[type])(start, object);
-#else
- if (Pointerp(object)) {
+ if (is_lisp_pointer(object)) {
/* It be a pointer. */
if (from_space_p(object)) {
/* It currently points to old space. Check for a */
/* forwarding pointer. */
lispobj first_word;
- first_word = *((lispobj *)PTR(object));
- if (Pointerp(first_word) && new_space_p(first_word)) {
+ first_word = *((lispobj *)native_pointer(object));
+ if (is_lisp_pointer(first_word) &&
+ new_space_p(first_word)) {
/* Yep, there be a forwarding pointer. */
*start = first_word;
words_scavenged = 1;
words_scavenged = (scavtab[type])(start, object);
}
-#endif
+
start += words_scavenged;
nwords -= words_scavenged;
}
gc_assert(nwords == 0);
}
-static void scavenge_newspace(void)
+static void
+scavenge_newspace(void)
{
lispobj *here, *next;
}
/* printf("done with newspace\n"); */
}
-
\f
-/* Scavenging Interrupt Contexts */
+/* scavenging interrupt contexts */
static int boxed_registers[] = BOXED_REGISTERS;
-static void scavenge_interrupt_context(os_context_t *context)
+static void
+scavenge_interrupt_context(os_context_t *context)
{
int i;
#ifdef reg_LIP
void scavenge_interrupt_contexts(void)
{
- int i, index;
- os_context_t *context;
+ int i, index;
+ os_context_t *context;
- index = fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX));
- printf("Number of active contexts: %d\n", index);
+ index = fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX));
- for (i = 0; i < index; i++) {
- context = lisp_interrupt_contexts[i];
- scavenge_interrupt_context(context);
- }
+ for (i = 0; i < index; i++) {
+ context = lisp_interrupt_contexts[i];
+ scavenge_interrupt_context(context);
+ }
}
\f
-/* Debugging Code */
+/* debugging code */
-void print_garbage(lispobj *from_space, lispobj *from_space_free_pointer)
+void
+print_garbage(lispobj *from_space, lispobj *from_space_free_pointer)
{
lispobj *start;
int total_words_not_copied;
lispobj header;
object = *start;
- forwardp = Pointerp(object) && new_space_p(object);
+ forwardp = is_lisp_pointer(object) && new_space_p(object);
if (forwardp) {
int tag;
nwords = 1;
break;
case type_OtherPointer:
- pointer = (lispobj *) PTR(object);
+ pointer = (lispobj *) native_pointer(object);
header = *pointer;
type = TypeOf(header);
nwords = (sizetab[type])(pointer);
}
\f
-/* Code and Code-Related Objects */
+/* code and code-related objects */
#define RAW_ADDR_OFFSET (6*sizeof(lispobj) - type_FunctionPointer)
static lispobj trans_function_header(lispobj object);
static lispobj trans_boxed(lispobj object);
-#if DIRECT_SCAV
-static int
-scav_function_pointer(lispobj *where, lispobj object)
-{
- gc_assert(Pointerp(object));
-
- if (from_space_p(object)) {
- lispobj first, *first_pointer;
-
- /* object is a pointer into from space. check to see */
- /* if it has been forwarded */
- first_pointer = (lispobj *) PTR(object);
- first = *first_pointer;
-
- if (!(Pointerp(first) && new_space_p(first))) {
- int type;
- lispobj copy;
-
- /* must transport object -- object may point */
- /* to either a function header, a closure */
- /* function header, or to a closure header. */
-
- type = TypeOf(first);
- switch (type) {
- case type_FunctionHeader:
- case type_ClosureFunctionHeader:
- copy = trans_function_header(object);
- break;
- default:
- copy = trans_boxed(object);
- break;
- }
-
- first = *first_pointer = copy;
- }
-
- gc_assert(Pointerp(first));
- gc_assert(!from_space_p(first));
-
- *where = first;
- }
- return 1;
-}
-#else
static int
scav_function_pointer(lispobj *where, lispobj object)
{
lispobj first;
int type;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
/* object is a pointer into from space. Not a FP */
- first_pointer = (lispobj *) PTR(object);
+ first_pointer = (lispobj *) native_pointer(object);
first = *first_pointer;
/* must transport object -- object may point */
first = *first_pointer = copy;
- gc_assert(Pointerp(first));
+ gc_assert(is_lisp_pointer(first));
gc_assert(!from_space_p(first));
*where = first;
return 1;
}
-#endif
static struct code *
trans_code(struct code *code)
/* if object has already been transported, just return pointer */
first = code->header;
- if (Pointerp(first) && new_space_p(first)) {
+ if (is_lisp_pointer(first) && new_space_p(first)) {
#ifdef DEBUG_CODE_GC
printf("Was already transported\n");
#endif
- return (struct code *) PTR(first);
+ return (struct code *) native_pointer(first);
}
gc_assert(TypeOf(first) == type_CodeHeader);
nwords = CEILING(nwords, 2);
l_new_code = copy_object(l_code, nwords);
- new_code = (struct code *) PTR(l_new_code);
+ new_code = (struct code *) native_pointer(l_new_code);
displacement = l_new_code - l_code;
struct function *fheaderp, *nfheaderp;
lispobj nfheaderl;
- fheaderp = (struct function *) PTR(fheaderl);
+ fheaderp = (struct function *) native_pointer(fheaderl);
gc_assert(TypeOf(fheaderp->header) == type_FunctionHeader);
/* calcuate the new function pointer and the new */
/* function header */
nfheaderl = fheaderl + displacement;
- nfheaderp = (struct function *) PTR(nfheaderl);
+ nfheaderp = (struct function *) native_pointer(nfheaderl);
/* set forwarding pointer */
#ifdef DEBUG_CODE_GC
/* code data block */
fheaderl = code->entry_points;
while (fheaderl != NIL) {
- fheaderp = (struct function *) PTR(fheaderl);
+ fheaderp = (struct function *) native_pointer(fheaderl);
gc_assert(TypeOf(fheaderp->header) == type_FunctionHeader);
#if defined(DEBUG_CODE_GC)
printf("Scavenging boxed section of entry point located at 0x%08x.\n",
- (unsigned long) PTR(fheaderl));
+ (unsigned long) native_pointer(fheaderl));
#endif
scavenge(&fheaderp->name, 1);
scavenge(&fheaderp->arglist, 1);
{
struct code *ncode;
- ncode = trans_code((struct code *) PTR(object));
+ ncode = trans_code((struct code *) native_pointer(object));
return (lispobj) LOW_WORD(ncode) | type_OtherPointer;
}
unsigned long offset;
struct code *code, *ncode;
lispobj ret;
- return_pc = (struct function *) PTR(object);
+ return_pc = (struct function *) native_pointer(object);
offset = HeaderValue(return_pc->header) * 4 ;
/* Transport the whole code object */
#endif
ncode = trans_code(code);
if(object==0x304748d7) {
- /* ldb_monitor(); */
+ /* monitor_or_something(); */
}
ret= ((lispobj) LOW_WORD(ncode) + offset) | type_OtherPointer;
#ifdef DEBUG_CODE_GC
return ret;
}
-/* On the 386, closures hold a pointer to the raw address instead of the
- function object, so we can use CALL [$FDEFN+const] to invoke the function
- without loading it into a register. Given that code objects don't move,
- we don't need to update anything, but we do have to figure out that the
- function is still live. */
-#ifdef i386
+/* On the 386, closures hold a pointer to the raw address instead of
+ * the function object, so we can use CALL [$FDEFN+const] to invoke
+ * the function without loading it into a register. Given that code
+ * objects don't move, we don't need to update anything, but we do
+ * have to figure out that the function is still live. */
+#ifdef __i386__
static
scav_closure_header(where, object)
lispobj *where, object;
unsigned long offset;
struct code *code, *ncode;
- fheader = (struct function *) PTR(object);
+ fheader = (struct function *) native_pointer(object);
offset = HeaderValue(fheader->header) * 4;
/* Transport the whole code object */
\f
-/* Instances */
+/* instances */
-#if DIRECT_SCAV
-static int
-scav_instance_pointer(lispobj *where, lispobj object)
-{
- if (from_space_p(object)) {
- lispobj first, *first_pointer;
-
- /* object is a pointer into from space. check to see */
- /* if it has been forwarded */
- first_pointer = (lispobj *) PTR(object);
- first = *first_pointer;
-
- if (!(Pointerp(first) && new_space_p(first)))
- first = *first_pointer = trans_boxed(object);
- *where = first;
- }
- return 1;
-}
-#else
static int
scav_instance_pointer(lispobj *where, lispobj object)
{
lispobj *first_pointer;
/* object is a pointer into from space. Not a FP */
- first_pointer = (lispobj *) PTR(object);
+ first_pointer = (lispobj *) native_pointer(object);
*where = *first_pointer = trans_boxed(object);
return 1;
}
-#endif
\f
-/* Lists and Conses */
+/* lists and conses */
static lispobj trans_list(lispobj object);
-#if DIRECT_SCAV
-static int
-scav_list_pointer(lispobj *where, lispobj object)
-{
- gc_assert(Pointerp(object));
-
- if (from_space_p(object)) {
- lispobj first, *first_pointer;
-
- /* object is a pointer into from space. check to see */
- /* if it has been forwarded */
- first_pointer = (lispobj *) PTR(object);
- first = *first_pointer;
-
- if (!(Pointerp(first) && new_space_p(first)))
- first = *first_pointer = trans_list(object);
-
- gc_assert(Pointerp(first));
- gc_assert(!from_space_p(first));
-
- *where = first;
- }
- return 1;
-}
-#else
static int
scav_list_pointer(lispobj *where, lispobj object)
{
lispobj first, *first_pointer;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
/* object is a pointer into from space. Not a FP. */
- first_pointer = (lispobj *) PTR(object);
+ first_pointer = (lispobj *) native_pointer(object);
first = *first_pointer = trans_list(object);
- gc_assert(Pointerp(first));
+ gc_assert(is_lisp_pointer(first));
gc_assert(!from_space_p(first));
*where = first;
return 1;
}
-#endif
static lispobj
trans_list(lispobj object)
lispobj new_list_pointer;
struct cons *cons, *new_cons;
- cons = (struct cons *) PTR(object);
+ cons = (struct cons *) native_pointer(object);
/* ### Don't use copy_object here. */
new_list_pointer = copy_object(object, 2);
- new_cons = (struct cons *) PTR(new_list_pointer);
+ new_cons = (struct cons *) native_pointer(new_list_pointer);
/* Set forwarding pointer. */
cons->car = new_list_pointer;
if (LowtagOf(cdr) != type_ListPointer ||
!from_space_p(cdr) ||
- (Pointerp(first = *(lispobj *)PTR(cdr)) &&
- new_space_p(first)))
+ (is_lisp_pointer(first = *(lispobj *)native_pointer(cdr))
+ && new_space_p(first)))
break;
- cdr_cons = (struct cons *) PTR(cdr);
+ cdr_cons = (struct cons *) native_pointer(cdr);
/* ### Don't use copy_object here */
new_cdr = copy_object(cdr, 2);
- new_cdr_cons = (struct cons *) PTR(new_cdr);
+ new_cdr_cons = (struct cons *) native_pointer(new_cdr);
/* Set forwarding pointer */
cdr_cons->car = new_cdr;
}
\f
-/* Scavenging and Transporting Other Pointers */
+/* scavenging and transporting other pointers */
-#if DIRECT_SCAV
-static int
-scav_other_pointer(lispobj *where, lispobj object)
-{
- gc_assert(Pointerp(object));
-
- if (from_space_p(object)) {
- lispobj first, *first_pointer;
-
- /* object is a pointer into from space. check to see */
- /* if it has been forwarded */
- first_pointer = (lispobj *) PTR(object);
- first = *first_pointer;
-
- if (!(Pointerp(first) && new_space_p(first)))
- first = *first_pointer =
- (transother[TypeOf(first)])(object);
-
- gc_assert(Pointerp(first));
- gc_assert(!from_space_p(first));
-
- *where = first;
- }
- return 1;
-}
-#else
static int
scav_other_pointer(lispobj *where, lispobj object)
{
lispobj first, *first_pointer;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
/* Object is a pointer into from space - not a FP */
- first_pointer = (lispobj *) PTR(object);
+ first_pointer = (lispobj *) native_pointer(object);
first = *first_pointer = (transother[TypeOf(*first_pointer)])(object);
- gc_assert(Pointerp(first));
+ gc_assert(is_lisp_pointer(first));
gc_assert(!from_space_p(first));
*where = first;
return 1;
}
-#endif
\f
-/* Immediate, Boxed, and Unboxed Objects */
+/* immediate, boxed, and unboxed objects */
static int
size_pointer(lispobj *where)
lispobj header;
unsigned long length;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- header = *((lispobj *) PTR(object));
+ header = *((lispobj *) native_pointer(object));
length = HeaderValue(header) + 1;
length = CEILING(length, 2);
}
/* Note: on the sparc we don't have to do anything special for fdefns, */
-/* cause the raw-addr has a function lowtag. */
+/* 'cause the raw-addr has a function lowtag. */
#ifndef sparc
static int
scav_fdefn(lispobj *where, lispobj object)
unsigned long length;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- header = *((lispobj *) PTR(object));
+ header = *((lispobj *) native_pointer(object));
length = HeaderValue(header) + 1;
length = CEILING(length, 2);
}
\f
-/* Vector-Like Objects */
+/* vector-like objects */
#define NWORDS(x,y) (CEILING((x),(y)) / (y))
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
/* NOTE: Strings contain one more byte of data than the length */
/* slot indicates. */
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length) + 1;
nwords = CEILING(NWORDS(length, 4) + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(length + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(NWORDS(length, 32) + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(NWORDS(length, 16) + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(NWORDS(length, 8) + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(NWORDS(length, 4) + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(NWORDS(length, 2) + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(length + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(length + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(length * 2 + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
#ifdef sparc
nwords = CEILING(length * 4 + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(length * 2 + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
nwords = CEILING(length * 4 + 2, 2);
struct vector *vector;
int length, nwords;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
- vector = (struct vector *) PTR(object);
+ vector = (struct vector *) native_pointer(object);
length = fixnum_value(vector->length);
#ifdef sparc
nwords = CEILING(length * 8 + 2, 2);
#endif
\f
-/* Weak Pointers */
+/* weak pointers */
#define WEAK_POINTER_NWORDS \
CEILING((sizeof(struct weak_pointer) / sizeof(lispobj)), 2)
lispobj copy;
struct weak_pointer *wp;
- gc_assert(Pointerp(object));
+ gc_assert(is_lisp_pointer(object));
#if defined(DEBUG_WEAK)
printf("Transporting weak pointer from 0x%08x\n", object);
/* been transported so they can be fixed up in a post-GC pass. */
copy = copy_object(object, WEAK_POINTER_NWORDS);
- wp = (struct weak_pointer *) PTR(copy);
+ wp = (struct weak_pointer *) native_pointer(copy);
/* Push the weak pointer onto the list of weak pointers. */
printf("Value: 0x%08x\n", (unsigned int) value);
#endif
- if (!(Pointerp(value) && from_space_p(value)))
+ if (!(is_lisp_pointer(value) && from_space_p(value)))
continue;
/* Now, we need to check if the object has been */
/* still good and needs to be updated. Otherwise, the */
/* weak pointer needs to be nil'ed out. */
- first_pointer = (lispobj *) PTR(value);
+ first_pointer = (lispobj *) native_pointer(value);
first = *first_pointer;
#if defined(DEBUG_WEAK)
printf("First: 0x%08x\n", (unsigned long) first);
#endif
- if (Pointerp(first) && new_space_p(first))
+ if (is_lisp_pointer(first) && new_space_p(first))
wp->value = first;
else {
wp->value = NIL;
\f
-/* Initialization */
+/* initialization */
static int
scav_lose(lispobj *where, lispobj object)
return 1;
}
-void gc_init(void)
+/* KLUDGE: SBCL already has two GC implementations, and if someday the
+ * precise generational GC is revived, it might have three. It would
+ * be nice to share the scavtab[] data set up here, and perhaps other
+ * things too, between all of them, rather than trying to maintain
+ * multiple copies. -- WHN 2001-05-09 */
+void
+gc_init(void)
{
int i;
- /* Scavenge Table */
+ /* scavenge table */
for (i = 0; i < 256; i++)
scavtab[i] = scav_lose;
/* scavtab[i] = scav_immediate; */
scavtab[type_FunctionHeader] = scav_function_header;
scavtab[type_ClosureFunctionHeader] = scav_function_header;
scavtab[type_ReturnPcHeader] = scav_return_pc_header;
-#ifdef i386
+#ifdef __i386__
scavtab[type_ClosureHeader] = scav_closure_header;
scavtab[type_FuncallableInstanceHeader] = scav_closure_header;
scavtab[type_ByteCodeFunction] = scav_closure_header;
sizetab[type_InstanceHeader] = size_boxed;
sizetab[type_Fdefn] = size_boxed;
}
-
-
\f
-/* Noise to manipulate the gc trigger stuff. */
-
-#ifndef ibmrt
+/* noise to manipulate the gc trigger stuff */
void set_auto_gc_trigger(os_vm_size_t dynamic_usage)
{
current_auto_gc_trigger = NULL;
}
}
-
-#endif