emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master a727a03: * src/alloc.c, src/lisp.h: Fix minor glitc


From: Paul Eggert
Subject: [Emacs-diffs] master a727a03: * src/alloc.c, src/lisp.h: Fix minor glitches in recent changes.
Date: Tue, 31 Jan 2017 16:31:17 +0000 (UTC)

branch: master
commit a727a0303eb34858389cb4331944e0e63411f2ff
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    * src/alloc.c, src/lisp.h: Fix minor glitches in recent changes.
---
 src/alloc.c |   24 ++++++++++--------------
 src/lisp.h  |    4 ++--
 2 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index dd2b688..b59220c 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5437,7 +5437,8 @@ make_pure_vector (ptrdiff_t len)
 /* Copy all contents and parameters of TABLE to a new table allocated
    from pure space, return the purified table.  */
 static struct Lisp_Hash_Table *
-purecopy_hash_table (struct Lisp_Hash_Table *table) {
+purecopy_hash_table (struct Lisp_Hash_Table *table)
+{
   eassert (NILP (table->weak));
   eassert (!NILP (table->pure));
 
@@ -5480,14 +5481,12 @@ Does not copy symbols.  Copies strings without text 
properties.  */)
     return purecopy (obj);
 }
 
-struct pinned_object
+/* Pinned objects are marked before every GC cycle.  */
+static struct pinned_object
 {
   Lisp_Object object;
   struct pinned_object *next;
-};
-
-/* Pinned objects are marked before every GC cycle.  */
-static struct pinned_object *pinned_objects;
+} *pinned_objects;
 
 static Lisp_Object
 purecopy (Lisp_Object obj)
@@ -5519,13 +5518,13 @@ purecopy (Lisp_Object obj)
   else if (HASH_TABLE_P (obj))
     {
       struct Lisp_Hash_Table *table = XHASH_TABLE (obj);
-      /* We cannot purify hash tables which haven't been defined with
+      /* Do not purify hash tables which haven't been defined with
          :purecopy as non-nil or are weak - they aren't guaranteed to
          not change.  */
       if (!NILP (table->weak) || NILP (table->pure))
         {
-          /* Instead, the hash table is added to the list of pinned objects,
-             and is marked before GC.  */
+          /* Instead, add the hash table to the list of pinned objects,
+             so that it will be marked during GC.  */
           struct pinned_object *o = xmalloc (sizeof *o);
           o->object = obj;
           o->next = pinned_objects;
@@ -5755,11 +5754,8 @@ compact_undo_list (Lisp_Object list)
 static void
 mark_pinned_objects (void)
 {
-  struct pinned_object *pobj;
-  for (pobj = pinned_objects; pobj; pobj = pobj->next)
-    {
-      mark_object (pobj->object);
-    }
+  for (struct pinned_object *pobj = pinned_objects; pobj; pobj = pobj->next)
+    mark_object (pobj->object);
 }
 
 static void
diff --git a/src/lisp.h b/src/lisp.h
index 91c430f..58e2288 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1995,8 +1995,8 @@ struct Lisp_Hash_Table
      hash table size to reduce collisions.  */
   Lisp_Object index;
 
-  /* Non-nil if the table can be purecopied. Any changes the table after
-     purecopy will result in an error.  */
+  /* Non-nil if the table can be purecopied.  The table cannot be
+     changed afterwards.  */
   Lisp_Object pure;
 
   /* Only the fields above are traced normally by the GC.  The ones below



reply via email to

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