]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 20 Sep 2012 03:10:52 +0000 (23:10 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 20 Sep 2012 03:10:52 +0000 (23:10 -0400)
calling mark_vectorlike since that's the one that marks the window.
(mark_discard_killed_buffers): Mark the final cdr.
* src/window.h (struct window): Move prev/next_buffers to the
non-standard fields.
* src/window.c (make_window): Initialize prev/next_buffers manually.

src/ChangeLog
src/alloc.c
src/window.c
src/window.h

index 7f9cac9fa21b8baa201ed8c3b4f65a9e2fa6c2dc..c3ce1ee1b0b3ef788d341d709f6f6b619d77da16 100644 (file)
@@ -1,3 +1,12 @@
+2012-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
+       calling mark_vectorlike since that's the one that marks the window.
+       (mark_discard_killed_buffers): Mark the final cdr.
+       * window.h (struct window): Move prev/next_buffers to the
+       non-standard fields.
+       * window.c (make_window): Initialize prev/next_buffers manually.
+
 2012-09-20  Paul Eggert  <eggert@cs.ucla.edu>
 
        Omit unused arg EXPECTED from socket hooks.
index fb7d35b55902f0ad286c0566f828b7ddaf57840d..02ba2f5f9e357d5820ab55755294258bca328742 100644 (file)
@@ -5521,7 +5521,7 @@ mark_buffer (struct buffer *buffer)
 }
 
 /* Remove killed buffers or items whose car is a killed buffer from
-   LIST, and mark other items. Return changed LIST, which is marked.  */
+   LIST, and mark other items.  Return changed LIST, which is marked.  */
 
 static Lisp_Object
 mark_discard_killed_buffers (Lisp_Object list)
@@ -5543,6 +5543,7 @@ mark_discard_killed_buffers (Lisp_Object list)
          prev = &XCDR_AS_LVALUE (tail);
        }
     }
+  mark_object (tail);
   return list;
 }
 
@@ -5691,18 +5692,8 @@ mark_object (Lisp_Object arg)
              struct window *w = (struct window *) ptr;
              bool leaf = NILP (w->hchild) && NILP (w->vchild);
 
-             /* For live windows, Lisp code filters out killed buffers
-                from both buffer lists.  For dead windows, we do it here
-                in attempt to help GC to reclaim killed buffers faster.  */
-             if (leaf && NILP (w->buffer))
-               {
-                 wset_prev_buffers
-                   (w, mark_discard_killed_buffers (w->prev_buffers));
-                 wset_next_buffers
-                   (w, mark_discard_killed_buffers (w->next_buffers));
-               }
-
              mark_vectorlike (ptr);
+
              /* Mark glyphs for leaf windows.  Marking window
                 matrices is sufficient because frame matrices
                 use the same glyph memory.  */
@@ -5711,6 +5702,15 @@ mark_object (Lisp_Object arg)
                  mark_glyph_matrix (w->current_matrix);
                  mark_glyph_matrix (w->desired_matrix);
                }
+
+             /* Filter out killed buffers from both buffer lists
+                in attempt to help GC to reclaim killed buffers faster.
+                We can do it elsewhere for live windows, but this is the
+                best place to do it for dead windows.  */
+             wset_prev_buffers
+               (w, mark_discard_killed_buffers (w->prev_buffers));
+             wset_next_buffers
+               (w, mark_discard_killed_buffers (w->next_buffers));
            }
            break;
 
index fbccab8b358e1e0a17d8501b51947debc7674e6b..a6f1104587e87c04ed4385622c4483677d670ede 100644 (file)
@@ -3462,7 +3462,11 @@ make_window (void)
   wset_vertical_scroll_bar_type (w, Qt);
   wset_window_end_pos (w, make_number (0));
   wset_window_end_vpos (w, make_number (0));
-
+  /* These Lisp fields are marked specially so they're not set to nil by
+     allocate_window.  */
+  wset_prev_buffers (w, Qnil);
+  wset_next_buffers (w, Qnil);
+  
   /* Initialize non-Lisp data.  Note that allocate_window zeroes out all
      non-Lisp data, so do it only for slots which should not be zero.  */
   w->nrows_scale_factor = w->ncols_scale_factor = 1;
index 62ae43a999d83326c30de060eb4197f3bdeb04f5..115b361194c25623440a8c340f85c976d9ce6a68 100644 (file)
@@ -220,13 +220,6 @@ struct window
     /* t means this window's child windows are not (re-)combined.  */
     Lisp_Object combination_limit;
 
-    /* Alist of <buffer, window-start, window-point> triples listing
-       buffers previously shown in this window.  */
-    Lisp_Object prev_buffers;
-
-    /* List of buffers re-shown in this window.  */
-    Lisp_Object next_buffers;
-
     /* An alist with parameters.  */
     Lisp_Object window_parameters;
 
@@ -238,6 +231,14 @@ struct window
     struct glyph_matrix *current_matrix;
     struct glyph_matrix *desired_matrix;
 
+    /* The two Lisp_Object fields below are marked in a special way,
+       which is why they're placed after `current_matrix'.  */
+    /* Alist of <buffer, window-start, window-point> triples listing
+       buffers previously shown in this window.  */
+    Lisp_Object prev_buffers;
+    /* List of buffers re-shown in this window.  */
+    Lisp_Object next_buffers;
+
     /* Number saying how recently window was selected.  */
     int use_time;