aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-02 17:45:40 +0000
committerRichard M. Stallman1994-06-02 17:45:40 +0000
commit2d1687d7f4beaba2c578403d00835d2eeecb40c2 (patch)
treed9012718aa0d52b3631e63c09864c83127a43bdf
parent22f33dd9d2e0aa95231fb3d8409a1d26ed6b067d (diff)
downloademacs-2d1687d7f4beaba2c578403d00835d2eeecb40c2.tar.gz
emacs-2d1687d7f4beaba2c578403d00835d2eeecb40c2.zip
[emacs]: Block input around the garbage reclamation.
Include blockinput.h.
-rw-r--r--src/alloca.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/alloca.c b/src/alloca.c
index bd4932aa445..d1f4d1a302b 100644
--- a/src/alloca.c
+++ b/src/alloca.c
@@ -29,6 +29,10 @@
29#endif 29#endif
30#endif 30#endif
31 31
32#ifdef emacs
33#include "blockinput.h"
34#endif
35
32/* If compiling with GCC 2, this file's not needed. */ 36/* If compiling with GCC 2, this file's not needed. */
33#if !defined (__GNUC__) || __GNUC__ < 2 37#if !defined (__GNUC__) || __GNUC__ < 2
34 38
@@ -176,6 +180,10 @@ alloca (size)
176 { 180 {
177 register header *hp; /* Traverses linked list. */ 181 register header *hp; /* Traverses linked list. */
178 182
183#ifdef emacs
184 BLOCK_INPUT;
185#endif
186
179 for (hp = last_alloca_header; hp != NULL;) 187 for (hp = last_alloca_header; hp != NULL;)
180 if ((STACK_DIR > 0 && hp->h.deep > depth) 188 if ((STACK_DIR > 0 && hp->h.deep > depth)
181 || (STACK_DIR < 0 && hp->h.deep < depth)) 189 || (STACK_DIR < 0 && hp->h.deep < depth))
@@ -190,6 +198,10 @@ alloca (size)
190 break; /* Rest are not deeper. */ 198 break; /* Rest are not deeper. */
191 199
192 last_alloca_header = hp; /* -> last valid storage. */ 200 last_alloca_header = hp; /* -> last valid storage. */
201
202#ifdef emacs
203 UNBLOCK_INPUT;
204#endif
193 } 205 }
194 206
195 if (size == 0) 207 if (size == 0)