Commit aee625fa authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(sweep_weak_table): Mark only objects that are not

marked already.
parent 67c9a1d2
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.
......
......@@ -4175,14 +4175,17 @@ sweep_weak_table (h, remove_entries_p)
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 ();
......@@ -4214,9 +4217,17 @@ sweep_weak_table (h, remove_entries_p)
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;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment