aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-08-07 12:04:06 +0000
committerGerd Moellmann2000-08-07 12:04:06 +0000
commitac0e96eefcdea2d4e61af557d629ff46db8da990 (patch)
tree34e03c45e51dd78cf1719214c3542c3a9a09b843 /src
parentff3d95733df693020bbbaa4d5acfc99cd4d4c08b (diff)
downloademacs-ac0e96eefcdea2d4e61af557d629ff46db8da990.tar.gz
emacs-ac0e96eefcdea2d4e61af557d629ff46db8da990.zip
(sweep_weak_hash_tables): Fix the code taking unmarked
tables out of the list of all weak hash tables.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/fns.c27
2 files changed, 15 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2ced3a81004..46e0bddf112 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12000-08-07 Gerd Moellmann <gerd@gnu.org> 12000-08-07 Gerd Moellmann <gerd@gnu.org>
2 2
3 * fns.c (sweep_weak_hash_tables): Fix the code taking unmarked
4 tables out of the list of all weak hash tables.
5
3 * xdisp.c (ensure_echo_area_buffers): If a buffer was killed, and 6 * xdisp.c (ensure_echo_area_buffers): If a buffer was killed, and
4 a new buffer is created, make sure echo_area_buffer[] references 7 a new buffer is created, make sure echo_area_buffer[] references
5 the new buffer. 8 the new buffer.
diff --git a/src/fns.c b/src/fns.c
index 51169efca73..1bd21d7783a 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4380,8 +4380,8 @@ sweep_weak_table (h, remove_entries_p)
4380void 4380void
4381sweep_weak_hash_tables () 4381sweep_weak_hash_tables ()
4382{ 4382{
4383 Lisp_Object table; 4383 Lisp_Object table, used, next;
4384 struct Lisp_Hash_Table *h, *prev; 4384 struct Lisp_Hash_Table *h;
4385 int marked; 4385 int marked;
4386 4386
4387 /* Mark all keys and values that are in use. Keep on marking until 4387 /* Mark all keys and values that are in use. Keep on marking until
@@ -4403,27 +4403,24 @@ sweep_weak_hash_tables ()
4403 while (marked); 4403 while (marked);
4404 4404
4405 /* Remove tables and entries that aren't used. */ 4405 /* Remove tables and entries that aren't used. */
4406 prev = NULL; 4406 for (table = Vweak_hash_tables, used = Qnil; !GC_NILP (table); table = next)
4407 for (table = Vweak_hash_tables; !GC_NILP (table); table = h->next_weak)
4408 { 4407 {
4409 prev = h;
4410 h = XHASH_TABLE (table); 4408 h = XHASH_TABLE (table);
4411 4409 next = h->next_weak;
4410
4412 if (h->size & ARRAY_MARK_FLAG) 4411 if (h->size & ARRAY_MARK_FLAG)
4413 { 4412 {
4413 /* TABLE is marked as used. Sweep its contents. */
4414 if (XFASTINT (h->count) > 0) 4414 if (XFASTINT (h->count) > 0)
4415 sweep_weak_table (h, 1); 4415 sweep_weak_table (h, 1);
4416 } 4416
4417 else 4417 /* Add table to the list of used weak hash tables. */
4418 { 4418 h->next_weak = used;
4419 /* Table is not marked, and will thus be freed. 4419 used = table;
4420 Take it out of the list of weak hash tables. */
4421 if (prev)
4422 prev->next_weak = h->next_weak;
4423 else
4424 Vweak_hash_tables = h->next_weak;
4425 } 4420 }
4426 } 4421 }
4422
4423 Vweak_hash_tables = used;
4427} 4424}
4428 4425
4429 4426