emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 6c12f4e 2/3: Simplify mark_object for pseudovectors


From: Paul Eggert
Subject: [Emacs-diffs] master 6c12f4e 2/3: Simplify mark_object for pseudovectors
Date: Sat, 11 Aug 2018 21:50:32 -0400 (EDT)

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

    Simplify mark_object for pseudovectors
    
    Suggested by Pip Cet (Bug#32405#14).
    * src/alloc.c (mark_object): Remove unnecessary special cases for
    PVEC_MARKER, PVEC_BOOL_VECTOR, PVEC_MISC_PTR, PVEC_USER_PTR, and
    PVEC_FINALIZER.
    
    change is to free up an enum Lisp_Type tag value, a scarce
---
 src/alloc.c | 20 ++------------------
 src/lisp.h  |  4 +++-
 2 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index fea0cec..337668f 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6495,28 +6495,10 @@ mark_object (Lisp_Object arg)
            mark_char_table (ptr, (enum pvec_type) pvectype);
            break;
 
-         case PVEC_MARKER:
-           /* DO NOT mark thru the marker's chain.
-              The buffer's markers chain does not preserve markers from gc;
-              instead, markers are removed from the chain when freed by gc.  */
-         case PVEC_BOOL_VECTOR:
-         case PVEC_MISC_PTR:
-#ifdef HAVE_MODULES
-         case PVEC_USER_PTR:
-#endif
-           /* No Lisp_Objects to mark in these.  */
-           VECTOR_MARK (ptr);
-           break;
-
          case PVEC_OVERLAY:
            mark_overlay (XOVERLAY (obj));
            break;
 
-         case PVEC_FINALIZER:
-           VECTOR_MARK (ptr);
-           mark_object (XFINALIZER (obj)->function);
-           break;
-
          case PVEC_SUBR:
            break;
 
@@ -6524,6 +6506,8 @@ mark_object (Lisp_Object arg)
            emacs_abort ();
 
          default:
+           /* A regular vector, or a pseudovector needing no special
+              treatment.  */
            mark_vectorlike (ptr);
          }
       }
diff --git a/src/lisp.h b/src/lisp.h
index c080cc6..dcc157e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2264,7 +2264,9 @@ struct Lisp_Marker
      does not point anywhere.  */
 
   /* For markers that point somewhere,
-     this is used to chain of all the markers in a given buffer.  */
+     this is used to chain of all the markers in a given buffer.
+     The chain does not preserve markers from garbage collection;
+     instead, markers are removed from the chain when freed by GC.  */
   /* We could remove it and use an array in buffer_text instead.
      That would also allow us to preserve it ordered.  */
   struct Lisp_Marker *next;



reply via email to

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