emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/fns.c,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/fns.c,v
Date: Wed, 11 Jul 2007 15:26:24 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/07/11 15:26:24

Index: fns.c
===================================================================
RCS file: /sources/emacs/emacs/src/fns.c,v
retrieving revision 1.427
retrieving revision 1.428
diff -u -b -r1.427 -r1.428
--- fns.c       10 Jul 2007 15:40:06 -0000      1.427
+++ fns.c       11 Jul 2007 15:26:24 -0000      1.428
@@ -4268,7 +4268,7 @@
 
 /* The list of all weak hash tables.  Don't staticpro this one.  */
 
-Lisp_Object Vweak_hash_tables;
+struct Lisp_Hash_Table *weak_hash_tables;
 
 /* Various symbols.  */
 
@@ -4614,11 +4614,11 @@
 
   /* Maybe add this hash table to the list of all weak hash tables.  */
   if (NILP (h->weak))
-    h->next_weak = Qnil;
+    h->next_weak = NULL;
   else
     {
-      h->next_weak = Vweak_hash_tables;
-      Vweak_hash_tables = table;
+      h->next_weak = weak_hash_tables;
+      weak_hash_tables = h;
     }
 
   return table;
@@ -4649,8 +4649,8 @@
   /* Maybe add this hash table to the list of all weak hash tables.  */
   if (!NILP (h2->weak))
     {
-      h2->next_weak = Vweak_hash_tables;
-      Vweak_hash_tables = table;
+      h2->next_weak = weak_hash_tables;
+      weak_hash_tables = h2;
     }
 
   return table;
@@ -4969,13 +4969,12 @@
 
 /* Remove elements from weak hash tables that don't survive the
    current garbage collection.  Remove weak tables that don't survive
-   from Vweak_hash_tables.  Called from gc_sweep.  */
+   from weak_hash_tables.  Called from gc_sweep.  */
 
 void
 sweep_weak_hash_tables ()
 {
-  Lisp_Object table, used, next;
-  struct Lisp_Hash_Table *h;
+  struct Lisp_Hash_Table *h, *used, *next;
   int marked;
 
   /* Mark all keys and values that are in use.  Keep on marking until
@@ -4987,9 +4986,8 @@
   do
     {
       marked = 0;
-      for (table = Vweak_hash_tables; !GC_NILP (table); table = h->next_weak)
+      for (h = weak_hash_tables; h; h = h->next_weak)
        {
-         h = XHASH_TABLE (table);
          if (h->size & ARRAY_MARK_FLAG)
            marked |= sweep_weak_table (h, 0);
        }
@@ -4997,9 +4995,8 @@
   while (marked);
 
   /* Remove tables and entries that aren't used.  */
-  for (table = Vweak_hash_tables, used = Qnil; !GC_NILP (table); table = next)
+  for (h = weak_hash_tables, used = NULL; h; h = next)
     {
-      h = XHASH_TABLE (table);
       next = h->next_weak;
 
       if (h->size & ARRAY_MARK_FLAG)
@@ -5010,11 +5007,11 @@
 
          /* Add table to the list of used weak hash tables.  */
          h->next_weak = used;
-         used = table;
+         used = h;
        }
     }
 
-  Vweak_hash_tables = used;
+  weak_hash_tables = used;
 }
 
 
@@ -5915,7 +5912,7 @@
 void
 init_fns ()
 {
-  Vweak_hash_tables = Qnil;
+  weak_hash_tables = NULL;
 }
 
 /* arch-tag: 787f8219-5b74-46bd-8469-7e1cc475fa31




reply via email to

[Prev in Thread] Current Thread [Next in Thread]