aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-09-11 13:35:23 -0700
committerPaul Eggert2012-09-11 13:35:23 -0700
commit5779a1dc62593be8294edaecfecca4359be9ab4e (patch)
treea06911ec707e4c6b3f59879e495e7ed2f8a71af1
parent9011078f9df40965a6ef3cade5bba3e5d0eb730d (diff)
downloademacs-5779a1dc62593be8294edaecfecca4359be9ab4e.tar.gz
emacs-5779a1dc62593be8294edaecfecca4359be9ab4e.zip
* 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.
-rw-r--r--src/ChangeLog7
-rw-r--r--src/alloc.c20
2 files changed, 15 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6cb0e65281a..2b0686cc49e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2
3 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
4 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5 time an item is removed. No need to mark this function 'inline';
6 the compiler knows better than we do.
7
12012-09-11 Jan Djärv <jan.h.d@swipnet.se> 82012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2 9
3 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize. 10 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
diff --git a/src/alloc.c b/src/alloc.c
index fb16b7d7511..61cb7086c25 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5868,25 +5868,21 @@ mark_buffer (struct buffer *buffer)
5868/* Remove killed buffers or items whose car is a killed buffer 5868/* Remove killed buffers or items whose car is a killed buffer
5869 from LIST and return changed LIST. Called during GC. */ 5869 from LIST and return changed LIST. Called during GC. */
5870 5870
5871static inline Lisp_Object 5871static Lisp_Object
5872discard_killed_buffers (Lisp_Object list) 5872discard_killed_buffers (Lisp_Object list)
5873{ 5873{
5874 Lisp_Object tail, prev, tem; 5874 Lisp_Object *prev = &list;
5875 Lisp_Object tail;
5875 5876
5876 for (tail = list, prev = Qnil; CONSP (tail); tail = XCDR (tail)) 5877 for (tail = list; CONSP (tail); tail = XCDR (tail))
5877 { 5878 {
5878 tem = XCAR (tail); 5879 Lisp_Object tem = XCAR (tail);
5879 if (CONSP (tem)) 5880 if (CONSP (tem))
5880 tem = XCAR (tem); 5881 tem = XCAR (tem);
5881 if (BUFFERP (tem) && !BUFFER_LIVE_P (XBUFFER (tem))) 5882 if (BUFFERP (tem) && !BUFFER_LIVE_P (XBUFFER (tem)))
5882 { 5883 *prev = XCDR (tail);
5883 if (NILP (prev))
5884 list = XCDR (tail);
5885 else
5886 XSETCDR (prev, XCDR (tail));
5887 }
5888 else 5884 else
5889 prev = tail; 5885 prev = &XCDR_AS_LVALUE (tail);
5890 } 5886 }
5891 return list; 5887 return list;
5892} 5888}
@@ -6045,7 +6041,7 @@ mark_object (Lisp_Object arg)
6045 { 6041 {
6046 struct window *w = (struct window *) ptr; 6042 struct window *w = (struct window *) ptr;
6047 bool leaf = NILP (w->hchild) && NILP (w->vchild); 6043 bool leaf = NILP (w->hchild) && NILP (w->vchild);
6048 6044
6049 /* For live windows, Lisp code filters out killed buffers 6045 /* For live windows, Lisp code filters out killed buffers
6050 from both buffer lists. For dead windows, we do it here 6046 from both buffer lists. For dead windows, we do it here
6051 in attempt to help GC to reclaim killed buffers faster. */ 6047 in attempt to help GC to reclaim killed buffers faster. */