aboutsummaryrefslogtreecommitdiffstats
path: root/src/fns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/fns.c b/src/fns.c
index 4967569f023..854d6788e68 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3641,7 +3641,7 @@ base64_decode_1 (from, to, length, multibyte, nchars_return)
3641 3641
3642/* The list of all weak hash tables. Don't staticpro this one. */ 3642/* The list of all weak hash tables. Don't staticpro this one. */
3643 3643
3644Lisp_Object Vweak_hash_tables; 3644struct Lisp_Hash_Table *weak_hash_tables;
3645 3645
3646/* Various symbols. */ 3646/* Various symbols. */
3647 3647
@@ -3987,11 +3987,11 @@ make_hash_table (test, size, rehash_size, rehash_threshold, weak,
3987 3987
3988 /* Maybe add this hash table to the list of all weak hash tables. */ 3988 /* Maybe add this hash table to the list of all weak hash tables. */
3989 if (NILP (h->weak)) 3989 if (NILP (h->weak))
3990 h->next_weak = Qnil; 3990 h->next_weak = NULL;
3991 else 3991 else
3992 { 3992 {
3993 h->next_weak = Vweak_hash_tables; 3993 h->next_weak = weak_hash_tables;
3994 Vweak_hash_tables = table; 3994 weak_hash_tables = h;
3995 } 3995 }
3996 3996
3997 return table; 3997 return table;
@@ -4022,8 +4022,8 @@ copy_hash_table (h1)
4022 /* Maybe add this hash table to the list of all weak hash tables. */ 4022 /* Maybe add this hash table to the list of all weak hash tables. */
4023 if (!NILP (h2->weak)) 4023 if (!NILP (h2->weak))
4024 { 4024 {
4025 h2->next_weak = Vweak_hash_tables; 4025 h2->next_weak = weak_hash_tables;
4026 Vweak_hash_tables = table; 4026 weak_hash_tables = h2;
4027 } 4027 }
4028 4028
4029 return table; 4029 return table;
@@ -4347,8 +4347,7 @@ sweep_weak_table (h, remove_entries_p)
4347void 4347void
4348sweep_weak_hash_tables () 4348sweep_weak_hash_tables ()
4349{ 4349{
4350 Lisp_Object table, used, next; 4350 struct Lisp_Hash_Table *h, *used, *next;
4351 struct Lisp_Hash_Table *h;
4352 int marked; 4351 int marked;
4353 4352
4354 /* Mark all keys and values that are in use. Keep on marking until 4353 /* Mark all keys and values that are in use. Keep on marking until
@@ -4360,9 +4359,8 @@ sweep_weak_hash_tables ()
4360 do 4359 do
4361 { 4360 {
4362 marked = 0; 4361 marked = 0;
4363 for (table = Vweak_hash_tables; !NILP (table); table = h->next_weak) 4362 for (h = weak_hash_tables; h; h = h->next_weak)
4364 { 4363 {
4365 h = XHASH_TABLE (table);
4366 if (h->size & ARRAY_MARK_FLAG) 4364 if (h->size & ARRAY_MARK_FLAG)
4367 marked |= sweep_weak_table (h, 0); 4365 marked |= sweep_weak_table (h, 0);
4368 } 4366 }
@@ -4370,9 +4368,8 @@ sweep_weak_hash_tables ()
4370 while (marked); 4368 while (marked);
4371 4369
4372 /* Remove tables and entries that aren't used. */ 4370 /* Remove tables and entries that aren't used. */
4373 for (table = Vweak_hash_tables, used = Qnil; !NILP (table); table = next) 4371 for (h = weak_hash_tables, used = NULL; h; h = next)
4374 { 4372 {
4375 h = XHASH_TABLE (table);
4376 next = h->next_weak; 4373 next = h->next_weak;
4377 4374
4378 if (h->size & ARRAY_MARK_FLAG) 4375 if (h->size & ARRAY_MARK_FLAG)
@@ -4383,11 +4380,11 @@ sweep_weak_hash_tables ()
4383 4380
4384 /* Add table to the list of used weak hash tables. */ 4381 /* Add table to the list of used weak hash tables. */
4385 h->next_weak = used; 4382 h->next_weak = used;
4386 used = table; 4383 used = h;
4387 } 4384 }
4388 } 4385 }
4389 4386
4390 Vweak_hash_tables = used; 4387 weak_hash_tables = used;
4391} 4388}
4392 4389
4393 4390
@@ -5277,7 +5274,7 @@ used if both `use-dialog-box' and this variable are non-nil. */);
5277void 5274void
5278init_fns () 5275init_fns ()
5279{ 5276{
5280 Vweak_hash_tables = Qnil; 5277 weak_hash_tables = NULL;
5281} 5278}
5282 5279
5283/* arch-tag: 787f8219-5b74-46bd-8469-7e1cc475fa31 5280/* arch-tag: 787f8219-5b74-46bd-8469-7e1cc475fa31