emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110107: * src/alloc.c (mark_object)


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110107: * src/alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
Date: Wed, 19 Sep 2012 23:10:52 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110107
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2012-09-19 23:10:52 -0400
message:
  * src/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.
  * src/window.h (struct window): Move prev/next_buffers to the
  non-standard fields.
  * src/window.c (make_window): Initialize prev/next_buffers manually.
modified:
  src/ChangeLog
  src/alloc.c
  src/window.c
  src/window.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-09-20 01:37:07 +0000
+++ b/src/ChangeLog     2012-09-20 03:10:52 +0000
@@ -1,3 +1,12 @@
+2012-09-20  Stefan Monnier  <address@hidden>
+
+       * 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  <address@hidden>
 
        Omit unused arg EXPECTED from socket hooks.

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2012-09-16 21:43:55 +0000
+++ b/src/alloc.c       2012-09-20 03:10:52 +0000
@@ -5521,7 +5521,7 @@
 }
 
 /* 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 @@
          prev = &XCDR_AS_LVALUE (tail);
        }
     }
+  mark_object (tail);
   return list;
 }
 
@@ -5691,18 +5692,8 @@
              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_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;
 

=== modified file 'src/window.c'
--- a/src/window.c      2012-09-16 10:25:24 +0000
+++ b/src/window.c      2012-09-20 03:10:52 +0000
@@ -3462,7 +3462,11 @@
   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;

=== modified file 'src/window.h'
--- a/src/window.h      2012-09-11 15:42:50 +0000
+++ b/src/window.h      2012-09-20 03:10:52 +0000
@@ -220,13 +220,6 @@
     /* 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 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;
 


reply via email to

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