aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-06-07 01:12:36 +0000
committerKarl Heuer1994-06-07 01:12:36 +0000
commit267ad509d7d9f5693c1cf891452225c682845696 (patch)
treef10fd3b8819ae1191aef15e59f5670571a77dc49 /src
parent7ad68eadd6367e19ea5623e9ac8097b87381809e (diff)
downloademacs-267ad509d7d9f5693c1cf891452225c682845696.tar.gz
emacs-267ad509d7d9f5693c1cf891452225c682845696.zip
(Fframe_or_buffer_changed_p): Reuse the state vector.
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 29b2777fd20..81470fba4ad 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1858,7 +1858,7 @@ update_line (frame, vpos)
1858 current_frame->charstarts[vpos] = temp1; 1858 current_frame->charstarts[vpos] = temp1;
1859} 1859}
1860 1860
1861/* A vector of size NFRAMES + 3 * NBUFFERS + 1, containing the session's 1861/* A vector of size >= NFRAMES + 3 * NBUFFERS + 1, containing the session's
1862 frames, buffers, buffer-read-only flags, and buffer-modified-flags, 1862 frames, buffers, buffer-read-only flags, and buffer-modified-flags,
1863 and a trailing sentinel (so we don't need to add length checks). */ 1863 and a trailing sentinel (so we don't need to add length checks). */
1864static Lisp_Object frame_and_buffer_state; 1864static Lisp_Object frame_and_buffer_state;
@@ -1897,7 +1897,10 @@ the current state.\n")
1897 n++; 1897 n++;
1898 for (tail = Vbuffer_alist; CONSP (tail); tail = XCONS (tail)->cdr) 1898 for (tail = Vbuffer_alist; CONSP (tail); tail = XCONS (tail)->cdr)
1899 n += 3; 1899 n += 3;
1900 frame_and_buffer_state = Fmake_vector (make_number (n), Qlambda); 1900 /* Reallocate the vector if it's grown, or if it's shrunk a lot. */
1901 if (n > XVECTOR (frame_and_buffer_state)->size
1902 || n < XVECTOR (frame_and_buffer_state)->size / 2)
1903 frame_and_buffer_state = Fmake_vector (make_number (n), Qlambda);
1901 vecp = XVECTOR (frame_and_buffer_state)->contents; 1904 vecp = XVECTOR (frame_and_buffer_state)->contents;
1902 FOR_EACH_FRAME (tail, frame) 1905 FOR_EACH_FRAME (tail, frame)
1903 *vecp++ = frame; 1906 *vecp++ = frame;
@@ -1908,6 +1911,9 @@ the current state.\n")
1908 *vecp++ = XBUFFER (buf)->read_only; 1911 *vecp++ = XBUFFER (buf)->read_only;
1909 *vecp++ = Fbuffer_modified_p (buf); 1912 *vecp++ = Fbuffer_modified_p (buf);
1910 } 1913 }
1914 /* If we left any slack in the vector, fill it up now. */
1915 for (; n < XVECTOR (frame_and_buffer_state)->size; ++n)
1916 *vecp++ = Qlambda;
1911 return Qt; 1917 return Qt;
1912} 1918}
1913 1919