aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/alloc.c b/src/alloc.c
index fb7d35b5590..02ba2f5f9e3 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5521,7 +5521,7 @@ mark_buffer (struct buffer *buffer)
5521} 5521}
5522 5522
5523/* Remove killed buffers or items whose car is a killed buffer from 5523/* Remove killed buffers or items whose car is a killed buffer from
5524 LIST, and mark other items. Return changed LIST, which is marked. */ 5524 LIST, and mark other items. Return changed LIST, which is marked. */
5525 5525
5526static Lisp_Object 5526static Lisp_Object
5527mark_discard_killed_buffers (Lisp_Object list) 5527mark_discard_killed_buffers (Lisp_Object list)
@@ -5543,6 +5543,7 @@ mark_discard_killed_buffers (Lisp_Object list)
5543 prev = &XCDR_AS_LVALUE (tail); 5543 prev = &XCDR_AS_LVALUE (tail);
5544 } 5544 }
5545 } 5545 }
5546 mark_object (tail);
5546 return list; 5547 return list;
5547} 5548}
5548 5549
@@ -5691,18 +5692,8 @@ mark_object (Lisp_Object arg)
5691 struct window *w = (struct window *) ptr; 5692 struct window *w = (struct window *) ptr;
5692 bool leaf = NILP (w->hchild) && NILP (w->vchild); 5693 bool leaf = NILP (w->hchild) && NILP (w->vchild);
5693 5694
5694 /* For live windows, Lisp code filters out killed buffers
5695 from both buffer lists. For dead windows, we do it here
5696 in attempt to help GC to reclaim killed buffers faster. */
5697 if (leaf && NILP (w->buffer))
5698 {
5699 wset_prev_buffers
5700 (w, mark_discard_killed_buffers (w->prev_buffers));
5701 wset_next_buffers
5702 (w, mark_discard_killed_buffers (w->next_buffers));
5703 }
5704
5705 mark_vectorlike (ptr); 5695 mark_vectorlike (ptr);
5696
5706 /* Mark glyphs for leaf windows. Marking window 5697 /* Mark glyphs for leaf windows. Marking window
5707 matrices is sufficient because frame matrices 5698 matrices is sufficient because frame matrices
5708 use the same glyph memory. */ 5699 use the same glyph memory. */
@@ -5711,6 +5702,15 @@ mark_object (Lisp_Object arg)
5711 mark_glyph_matrix (w->current_matrix); 5702 mark_glyph_matrix (w->current_matrix);
5712 mark_glyph_matrix (w->desired_matrix); 5703 mark_glyph_matrix (w->desired_matrix);
5713 } 5704 }
5705
5706 /* Filter out killed buffers from both buffer lists
5707 in attempt to help GC to reclaim killed buffers faster.
5708 We can do it elsewhere for live windows, but this is the
5709 best place to do it for dead windows. */
5710 wset_prev_buffers
5711 (w, mark_discard_killed_buffers (w->prev_buffers));
5712 wset_next_buffers
5713 (w, mark_discard_killed_buffers (w->next_buffers));
5714 } 5714 }
5715 break; 5715 break;
5716 5716