diff options
| author | Gerd Moellmann | 2000-07-03 12:29:36 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-07-03 12:29:36 +0000 |
| commit | aee625fa34f12d6b9e78e05e879a76495daa50b4 (patch) | |
| tree | 83726674987170de2b0213987509d214ac4dfb20 /src | |
| parent | 67c9a1d26efc40aca38419e38522d9690c6ab822 (diff) | |
| download | emacs-aee625fa34f12d6b9e78e05e879a76495daa50b4.tar.gz emacs-aee625fa34f12d6b9e78e05e879a76495daa50b4.zip | |
(sweep_weak_table): Mark only objects that are not
marked already.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/fns.c | 25 |
2 files changed, 21 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9e30bff4191..1bc2bf0b8bb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2000-07-03 Gerd Moellmann <gerd@gnu.org> | 1 | 2000-07-03 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * fns.c (sweep_weak_table): Mark only objects that are not | ||
| 4 | marked already. | ||
| 5 | |||
| 3 | * frame.c (next_frame, prev_frame): If MINIBUF is a window, | 6 | * frame.c (next_frame, prev_frame): If MINIBUF is a window, |
| 4 | include those frames as candidates which have their focus | 7 | include those frames as candidates which have their focus |
| 5 | redirected to the minibuffer frame. | 8 | redirected to the minibuffer frame. |
| @@ -4175,14 +4175,17 @@ sweep_weak_table (h, remove_entries_p) | |||
| 4175 | int remove_p; | 4175 | int remove_p; |
| 4176 | int i = XFASTINT (idx); | 4176 | int i = XFASTINT (idx); |
| 4177 | Lisp_Object next; | 4177 | Lisp_Object next; |
| 4178 | int key_known_to_survive_p, value_known_to_survive_p; | ||
| 4178 | 4179 | ||
| 4180 | key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i)); | ||
| 4181 | value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i)); | ||
| 4182 | |||
| 4179 | if (EQ (h->weak, Qkey)) | 4183 | if (EQ (h->weak, Qkey)) |
| 4180 | remove_p = !survives_gc_p (HASH_KEY (h, i)); | 4184 | remove_p = !key_known_to_survive_p; |
| 4181 | else if (EQ (h->weak, Qvalue)) | 4185 | else if (EQ (h->weak, Qvalue)) |
| 4182 | remove_p = !survives_gc_p (HASH_VALUE (h, i)); | 4186 | remove_p = !value_known_to_survive_p; |
| 4183 | else if (EQ (h->weak, Qt)) | 4187 | else if (EQ (h->weak, Qt)) |
| 4184 | remove_p = (!survives_gc_p (HASH_KEY (h, i)) | 4188 | remove_p = !key_known_to_survive_p || !value_known_to_survive_p; |
| 4185 | || !survives_gc_p (HASH_VALUE (h, i))); | ||
| 4186 | else | 4189 | else |
| 4187 | abort (); | 4190 | abort (); |
| 4188 | 4191 | ||
| @@ -4214,9 +4217,17 @@ sweep_weak_table (h, remove_entries_p) | |||
| 4214 | if (!remove_p) | 4217 | if (!remove_p) |
| 4215 | { | 4218 | { |
| 4216 | /* Make sure key and value survive. */ | 4219 | /* Make sure key and value survive. */ |
| 4217 | mark_object (&HASH_KEY (h, i)); | 4220 | if (!key_known_to_survive_p) |
| 4218 | mark_object (&HASH_VALUE (h, i)); | 4221 | { |
| 4219 | marked = 1; | 4222 | mark_object (&HASH_KEY (h, i)); |
| 4223 | marked = 1; | ||
| 4224 | } | ||
| 4225 | |||
| 4226 | if (!value_known_to_survive_p) | ||
| 4227 | { | ||
| 4228 | mark_object (&HASH_VALUE (h, i)); | ||
| 4229 | marked = 1; | ||
| 4230 | } | ||
| 4220 | } | 4231 | } |
| 4221 | } | 4232 | } |
| 4222 | 4233 | ||