From 10664515ac8fb3ef009c1f6ba2639fe064e509a9 Mon Sep 17 00:00:00 2001 From: wlott <wlott> Date: Mon, 2 Jul 1990 05:21:04 +0000 Subject: [PATCH] Hash-tables have to be invalidated when scavenged, not transported. --- ldb/gc.c | 22 ++++++++++++---------- ldb/purify.c | 9 ++++++++- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ldb/gc.c b/ldb/gc.c index ee2187797..4f1584045 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.9 1990/07/01 04:40:45 wlott Exp $ + * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/gc.c,v 1.10 1990/07/02 05:20:29 wlott Exp $ * * Written by Christopher Hoover. */ @@ -1084,6 +1084,16 @@ lispobj *where; return nwords; } +static +scav_vector(where, object) +lispobj *where, object; +{ + if (HeaderValue(object) == subtype_VectorValidHashing) + *where = (subtype_VectorMustRehash<<type_Bits) | type_SimpleVector; + + return 1; +} + static lispobj trans_vector(object) @@ -1100,14 +1110,6 @@ lispobj object; length = FIXNUM_TO_INT(vector->length); nwords = CEILING(length + 2, 2); - /* When transporting an EQ hashtable, GC must change subtype */ - /* so that the hash functions will know to rehash it. */ - - subtype = HeaderValue(vector->header); - if (subtype == subtype_VectorValidHashing) - vector->header = (subtype_VectorMustRehash<<8) | - type_SimpleVector; - return copy_object(object, nwords); } @@ -1637,7 +1639,7 @@ gc_init() scavtab[type_SimpleArray] = scav_boxed; scavtab[type_SimpleString] = scav_string; scavtab[type_SimpleBitVector] = scav_vector_bit; - scavtab[type_SimpleVector] = scav_boxed; + scavtab[type_SimpleVector] = scav_vector; scavtab[type_SimpleArrayUnsignedByte2] = scav_vector_unsigned_byte_2; scavtab[type_SimpleArrayUnsignedByte4] = scav_vector_unsigned_byte_4; scavtab[type_SimpleArrayUnsignedByte8] = scav_vector_unsigned_byte_8; diff --git a/ldb/purify.c b/ldb/purify.c index 1e0fda026..d8b0be997 100644 --- a/ldb/purify.c +++ b/ldb/purify.c @@ -1,6 +1,6 @@ /* Purify. */ -/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/purify.c,v 1.1 1990/07/01 04:51:15 wlott Exp $ */ +/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/purify.c,v 1.2 1990/07/02 05:21:04 wlott Exp $ */ #include <mach.h> @@ -398,6 +398,13 @@ static lispobj *pscav(addr, nwords) count = HeaderValue(thing)+1; break; + case type_SimpleVector: + if (HeaderValue(thing) == subtype_VectorValidHashing) + *addr = (subtype_VectorMustRehash<<type_Bits) | + type_SimpleVector; + count = 1; + break; + case type_SimpleString: vector = (struct vector *)addr; count = CEILING(NWORDS(FIXNUM_TO_INT(vector->length)+1,4)+2,2); -- GitLab