emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src ChangeLog alloc.c


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/src ChangeLog alloc.c
Date: Fri, 13 Nov 2009 15:26:30 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/11/13 15:26:29

Modified files:
        src            : ChangeLog alloc.c 

Log message:
        (mark_object): Don't reprocess marked strings.
        Check vector's markbit earlier.  Adjust calls to mark_vectorlike.
        (mark_vectorlike, mark_char_table): Assume the object is unmarked.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7865&r2=1.7866
http://cvs.savannah.gnu.org/viewcvs/emacs/src/alloc.c?cvsroot=emacs&r1=1.455&r2=1.456

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7865
retrieving revision 1.7866
diff -u -b -r1.7865 -r1.7866
--- ChangeLog   13 Nov 2009 11:18:02 -0000      1.7865
+++ ChangeLog   13 Nov 2009 15:26:28 -0000      1.7866
@@ -1,6 +1,12 @@
+2009-11-13  Stefan Monnier  <address@hidden>
+
+       * alloc.c (mark_object): Don't reprocess marked strings.
+       Check vector's markbit earlier.  Adjust calls to mark_vectorlike.
+       (mark_vectorlike, mark_char_table): Assume the object is unmarked.
+
 2009-11-13  Kenichi Handa  <address@hidden>
 
-       * category.c (word_boundary_p): Adjusted for the change of the
+       * category.c (word_boundary_p): Adjust for the change of the
        semantics of Vword_combining_categories.
        (Vword_combining_categories): Describe the slight change of the
        semantics.

Index: alloc.c
===================================================================
RCS file: /sources/emacs/emacs/src/alloc.c,v
retrieving revision 1.455
retrieving revision 1.456
diff -u -b -r1.455 -r1.456
--- alloc.c     11 Nov 2009 19:25:25 -0000      1.455
+++ alloc.c     13 Nov 2009 15:26:29 -0000      1.456
@@ -5357,16 +5357,14 @@
    Normally this is zero and the check never goes off.  */
 static int mark_object_loop_halt;
 
-/* Return non-zero if the object was not yet marked.  */
-static int
+static void
 mark_vectorlike (ptr)
      struct Lisp_Vector *ptr;
 {
   register EMACS_INT size = ptr->size;
   register int i;
 
-  if (VECTOR_MARKED_P (ptr))
-    return 0;                  /* Already marked */
+  eassert (!VECTOR_MARKED_P (ptr));
   VECTOR_MARK (ptr);           /* Else mark it */
   if (size & PSEUDOVECTOR_FLAG)
     size &= PSEUDOVECTOR_SIZE_MASK;
@@ -5377,7 +5375,6 @@
      non-Lisp_Object fields at the end of the structure.  */
   for (i = 0; i < size; i++) /* and then mark its elements */
     mark_object (ptr->contents[i]);
-  return 1;
 }
 
 /* Like mark_vectorlike but optimized for char-tables (and
@@ -5391,6 +5388,7 @@
   register EMACS_INT size = ptr->size & PSEUDOVECTOR_SIZE_MASK;
   register int i;
 
+  eassert (!VECTOR_MARKED_P (ptr));
   VECTOR_MARK (ptr);
   for (i = 0; i < size; i++)
     {
@@ -5472,6 +5470,8 @@
     case Lisp_String:
       {
        register struct Lisp_String *ptr = XSTRING (obj);
+       if (STRING_MARKED_P (ptr))
+         break;
        CHECK_ALLOCATED_AND_LIVE (live_string_p);
        MARK_INTERVAL_TREE (ptr->intervals);
        MARK_STRING (ptr);
@@ -5484,6 +5484,8 @@
       break;
 
     case Lisp_Vectorlike:
+      if (VECTOR_MARKED_P (XVECTOR (obj)))
+       break;
 #ifdef GC_CHECK_MARKED_OBJECTS
       m = mem_find (po);
       if (m == MEM_NIL && !SUBRP (obj)
@@ -5494,8 +5496,6 @@
 
       if (BUFFERP (obj))
        {
-         if (!VECTOR_MARKED_P (XBUFFER (obj)))
-           {
 #ifdef GC_CHECK_MARKED_OBJECTS
              if (po != &buffer_defaults && po != &buffer_local_symbols)
                {
@@ -5508,7 +5508,6 @@
 #endif /* GC_CHECK_MARKED_OBJECTS */
              mark_buffer (obj);
            }
-       }
       else if (SUBRP (obj))
        break;
       else if (COMPILEDP (obj))
@@ -5520,9 +5519,6 @@
          register EMACS_INT size = ptr->size;
          register int i;
 
-         if (VECTOR_MARKED_P (ptr))
-           break;   /* Already marked */
-
          CHECK_LIVE (live_vector_p);
          VECTOR_MARK (ptr);    /* Else mark it */
          size &= PSEUDOVECTOR_SIZE_MASK;
@@ -5537,15 +5533,14 @@
       else if (FRAMEP (obj))
        {
          register struct frame *ptr = XFRAME (obj);
-         if (mark_vectorlike (XVECTOR (obj)))
+         mark_vectorlike (XVECTOR (obj));
            mark_face_cache (ptr->face_cache);
        }
       else if (WINDOWP (obj))
        {
          register struct Lisp_Vector *ptr = XVECTOR (obj);
          struct window *w = XWINDOW (obj);
-         if (mark_vectorlike (ptr))
-           {
+         mark_vectorlike (ptr);
              /* Mark glyphs for leaf windows.  Marking window matrices is
                 sufficient because frame matrices use the same glyph
                 memory.  */
@@ -5557,24 +5552,19 @@
                  mark_glyph_matrix (w->desired_matrix);
                }
            }
-       }
       else if (HASH_TABLE_P (obj))
        {
          struct Lisp_Hash_Table *h = XHASH_TABLE (obj);
-         if (mark_vectorlike ((struct Lisp_Vector *)h))
-           { /* If hash table is not weak, mark all keys and values.
+         mark_vectorlike ((struct Lisp_Vector *)h);
+         /* If hash table is not weak, mark all keys and values.
                 For weak tables, mark only the vector.  */
              if (NILP (h->weak))
                mark_object (h->key_and_value);
              else
                VECTOR_MARK (XVECTOR (h->key_and_value));
            }
-       }
       else if (CHAR_TABLE_P (obj))
-       {
-         if (! VECTOR_MARKED_P (XVECTOR (obj)))
            mark_char_table (XVECTOR (obj));
-       }
       else
        mark_vectorlike (XVECTOR (obj));
       break;
@@ -5584,7 +5574,8 @@
        register struct Lisp_Symbol *ptr = XSYMBOL (obj);
        struct Lisp_Symbol *ptrx;
 
-       if (ptr->gcmarkbit) break;
+       if (ptr->gcmarkbit)
+         break;
        CHECK_ALLOCATED_AND_LIVE (live_symbol_p);
        ptr->gcmarkbit = 1;
        mark_object (ptr->value);
@@ -5689,7 +5680,8 @@
     case Lisp_Cons:
       {
        register struct Lisp_Cons *ptr = XCONS (obj);
-       if (CONS_MARKED_P (ptr)) break;
+       if (CONS_MARKED_P (ptr))
+         break;
        CHECK_ALLOCATED_AND_LIVE (live_cons_p);
        CONS_MARK (ptr);
        /* If the cdr is nil, avoid recursion for the car.  */
@@ -5734,6 +5726,7 @@
   register Lisp_Object *ptr, tmp;
   Lisp_Object base_buffer;
 
+  eassert (!VECTOR_MARKED_P (buffer));
   VECTOR_MARK (buffer);
 
   MARK_INTERVAL_TREE (BUF_INTERVALS (buffer));
@@ -5778,11 +5771,14 @@
   for (t = terminal_list; t; t = t->next_terminal)
     {
       eassert (t->name != NULL);
+      if (!VECTOR_MARKED_P (t))
+       {
 #ifdef HAVE_WINDOW_SYSTEM
       mark_image_cache (t->image_cache);
 #endif /* HAVE_WINDOW_SYSTEM */
       mark_vectorlike ((struct Lisp_Vector *)t);
     }
+    }
 }
 
 




reply via email to

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