Commit 5779a1dc authored by Paul Eggert's avatar Paul Eggert

* alloc.c (discard_killed_buffers): Tune and simplify a bit.

Use pointer-to-a-pointer to simplify and avoid a NILP check each
time an item is removed.  No need to mark this function 'inline';
the compiler knows better than we do.
parent 9011078f
2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c (discard_killed_buffers): Tune and simplify a bit.
Use pointer-to-a-pointer to simplify and avoid a NILP check each
time an item is removed. No need to mark this function 'inline';
the compiler knows better than we do.
2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
......
......@@ -5868,25 +5868,21 @@ mark_buffer (struct buffer *buffer)
/* Remove killed buffers or items whose car is a killed buffer
from LIST and return changed LIST. Called during GC. */
static inline Lisp_Object
static Lisp_Object
discard_killed_buffers (Lisp_Object list)
{
Lisp_Object tail, prev, tem;
Lisp_Object *prev = &list;
Lisp_Object tail;
for (tail = list, prev = Qnil; CONSP (tail); tail = XCDR (tail))
for (tail = list; CONSP (tail); tail = XCDR (tail))
{
tem = XCAR (tail);
Lisp_Object tem = XCAR (tail);
if (CONSP (tem))
tem = XCAR (tem);
if (BUFFERP (tem) && !BUFFER_LIVE_P (XBUFFER (tem)))
{
if (NILP (prev))
list = XCDR (tail);
else
XSETCDR (prev, XCDR (tail));
}
*prev = XCDR (tail);
else
prev = tail;
prev = &XCDR_AS_LVALUE (tail);
}
return list;
}
......@@ -6045,7 +6041,7 @@ 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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment