2000-07-03 Gerd Moellmann <gerd@gnu.org>
+ * fns.c (sweep_weak_table): Mark only objects that are not
+ marked already.
+
* frame.c (next_frame, prev_frame): If MINIBUF is a window,
include those frames as candidates which have their focus
redirected to the minibuffer frame.
int remove_p;
int i = XFASTINT (idx);
Lisp_Object next;
+ int key_known_to_survive_p, value_known_to_survive_p;
+ key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i));
+ value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i));
+
if (EQ (h->weak, Qkey))
- remove_p = !survives_gc_p (HASH_KEY (h, i));
+ remove_p = !key_known_to_survive_p;
else if (EQ (h->weak, Qvalue))
- remove_p = !survives_gc_p (HASH_VALUE (h, i));
+ remove_p = !value_known_to_survive_p;
else if (EQ (h->weak, Qt))
- remove_p = (!survives_gc_p (HASH_KEY (h, i))
- || !survives_gc_p (HASH_VALUE (h, i)));
+ remove_p = !key_known_to_survive_p || !value_known_to_survive_p;
else
abort ();
if (!remove_p)
{
/* Make sure key and value survive. */
- mark_object (&HASH_KEY (h, i));
- mark_object (&HASH_VALUE (h, i));
- marked = 1;
+ if (!key_known_to_survive_p)
+ {
+ mark_object (&HASH_KEY (h, i));
+ marked = 1;
+ }
+
+ if (!value_known_to_survive_p)
+ {
+ mark_object (&HASH_VALUE (h, i));
+ marked = 1;
+ }
}
}