diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/alloc.c | 24 | ||||
| -rw-r--r-- | src/window.c | 6 | ||||
| -rw-r--r-- | src/window.h | 15 |
4 files changed, 34 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7f9cac9fa21..c3ce1ee1b0b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after* | ||
| 4 | calling mark_vectorlike since that's the one that marks the window. | ||
| 5 | (mark_discard_killed_buffers): Mark the final cdr. | ||
| 6 | * window.h (struct window): Move prev/next_buffers to the | ||
| 7 | non-standard fields. | ||
| 8 | * window.c (make_window): Initialize prev/next_buffers manually. | ||
| 9 | |||
| 1 | 2012-09-20 Paul Eggert <eggert@cs.ucla.edu> | 10 | 2012-09-20 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 11 | ||
| 3 | Omit unused arg EXPECTED from socket hooks. | 12 | Omit unused arg EXPECTED from socket hooks. |
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 | ||
| 5526 | static Lisp_Object | 5526 | static Lisp_Object |
| 5527 | mark_discard_killed_buffers (Lisp_Object list) | 5527 | mark_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 | ||
diff --git a/src/window.c b/src/window.c index fbccab8b358..a6f1104587e 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3462,7 +3462,11 @@ make_window (void) | |||
| 3462 | wset_vertical_scroll_bar_type (w, Qt); | 3462 | wset_vertical_scroll_bar_type (w, Qt); |
| 3463 | wset_window_end_pos (w, make_number (0)); | 3463 | wset_window_end_pos (w, make_number (0)); |
| 3464 | wset_window_end_vpos (w, make_number (0)); | 3464 | wset_window_end_vpos (w, make_number (0)); |
| 3465 | 3465 | /* These Lisp fields are marked specially so they're not set to nil by | |
| 3466 | allocate_window. */ | ||
| 3467 | wset_prev_buffers (w, Qnil); | ||
| 3468 | wset_next_buffers (w, Qnil); | ||
| 3469 | |||
| 3466 | /* Initialize non-Lisp data. Note that allocate_window zeroes out all | 3470 | /* Initialize non-Lisp data. Note that allocate_window zeroes out all |
| 3467 | non-Lisp data, so do it only for slots which should not be zero. */ | 3471 | non-Lisp data, so do it only for slots which should not be zero. */ |
| 3468 | w->nrows_scale_factor = w->ncols_scale_factor = 1; | 3472 | w->nrows_scale_factor = w->ncols_scale_factor = 1; |
diff --git a/src/window.h b/src/window.h index 62ae43a999d..115b361194c 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -220,13 +220,6 @@ struct window | |||
| 220 | /* t means this window's child windows are not (re-)combined. */ | 220 | /* t means this window's child windows are not (re-)combined. */ |
| 221 | Lisp_Object combination_limit; | 221 | Lisp_Object combination_limit; |
| 222 | 222 | ||
| 223 | /* Alist of <buffer, window-start, window-point> triples listing | ||
| 224 | buffers previously shown in this window. */ | ||
| 225 | Lisp_Object prev_buffers; | ||
| 226 | |||
| 227 | /* List of buffers re-shown in this window. */ | ||
| 228 | Lisp_Object next_buffers; | ||
| 229 | |||
| 230 | /* An alist with parameters. */ | 223 | /* An alist with parameters. */ |
| 231 | Lisp_Object window_parameters; | 224 | Lisp_Object window_parameters; |
| 232 | 225 | ||
| @@ -238,6 +231,14 @@ struct window | |||
| 238 | struct glyph_matrix *current_matrix; | 231 | struct glyph_matrix *current_matrix; |
| 239 | struct glyph_matrix *desired_matrix; | 232 | struct glyph_matrix *desired_matrix; |
| 240 | 233 | ||
| 234 | /* The two Lisp_Object fields below are marked in a special way, | ||
| 235 | which is why they're placed after `current_matrix'. */ | ||
| 236 | /* Alist of <buffer, window-start, window-point> triples listing | ||
| 237 | buffers previously shown in this window. */ | ||
| 238 | Lisp_Object prev_buffers; | ||
| 239 | /* List of buffers re-shown in this window. */ | ||
| 240 | Lisp_Object next_buffers; | ||
| 241 | |||
| 241 | /* Number saying how recently window was selected. */ | 242 | /* Number saying how recently window was selected. */ |
| 242 | int use_time; | 243 | int use_time; |
| 243 | 244 | ||