X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fgc-common.c;h=891d7179cd91039905fffa984329fefc1eeb09a1;hb=ebdf67c1da1884d5def43062a97174f28fcb6a2c;hp=0209fc7810128d38946350ae139469bc2c0d262b;hpb=3bb2fb5b9ecdeebecaded4ac6e5af0f653be8867;p=sbcl.git diff --git a/src/runtime/gc-common.c b/src/runtime/gc-common.c index 0209fc7..891d717 100644 --- a/src/runtime/gc-common.c +++ b/src/runtime/gc-common.c @@ -52,7 +52,8 @@ #include "lispregs.h" #include "arch.h" #include "gc.h" -#include "primitive-objects.h" +#include "genesis/primitive-objects.h" +#include "genesis/static-symbols.h" #include "gc-internal.h" #ifdef LISP_FEATURE_SPARC @@ -98,6 +99,9 @@ lispobj (*transother[256])(lispobj object); int (*sizetab[256])(lispobj *where); struct weak_pointer *weak_pointers; +unsigned long bytes_consed_between_gcs = 12*1024*1024; + + /* * copying objects */ @@ -845,6 +849,26 @@ size_vector(lispobj *where) } static int +scav_vector_nil(lispobj *where, lispobj object) +{ + return 2; +} + +static lispobj +trans_vector_nil(lispobj object) +{ + gc_assert(is_lisp_pointer(object)); + return copy_unboxed_object(object, 2); +} + +static int +size_vector_nil(lispobj *where) +{ + /* Just the header word and the length word */ + return 2; +} + +static int scav_vector_bit(lispobj *where, lispobj object) { struct vector *vector; @@ -1507,6 +1531,7 @@ gc_init_tables(void) scavtab[SIMPLE_ARRAY_WIDETAG] = scav_boxed; scavtab[SIMPLE_STRING_WIDETAG] = scav_string; scavtab[SIMPLE_BIT_VECTOR_WIDETAG] = scav_vector_bit; + scavtab[SIMPLE_ARRAY_NIL_WIDETAG] = scav_vector_nil; scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG] = scav_vector_unsigned_byte_2; scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG] = @@ -1602,6 +1627,7 @@ gc_init_tables(void) transother[SIMPLE_STRING_WIDETAG] = trans_string; transother[SIMPLE_BIT_VECTOR_WIDETAG] = trans_vector_bit; transother[SIMPLE_VECTOR_WIDETAG] = trans_vector; + transother[SIMPLE_ARRAY_NIL_WIDETAG] = trans_vector_nil; transother[SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG] = trans_vector_unsigned_byte_2; transother[SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG] = @@ -1701,6 +1727,7 @@ gc_init_tables(void) sizetab[SIMPLE_STRING_WIDETAG] = size_string; sizetab[SIMPLE_BIT_VECTOR_WIDETAG] = size_vector_bit; sizetab[SIMPLE_VECTOR_WIDETAG] = size_vector; + sizetab[SIMPLE_ARRAY_NIL_WIDETAG] = size_vector_nil; sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG] = size_vector_unsigned_byte_2; sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG] =