summaryrefslogtreecommitdiff
path: root/src/regex.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-07-05 07:25:05 +0000
committerRichard M. Stallman <rms@gnu.org>1994-07-05 07:25:05 +0000
commitad7a6138f2c6460b38c0115e713ff24b2b45f135 (patch)
tree55079dca821cc61896fac8bd4557d59c99dd1e67 /src/regex.c
parentdc80c8908d07cd6e7af399eca11098ba703d363a (diff)
downloademacs-ad7a6138f2c6460b38c0115e713ff24b2b45f135.tar.gz
Be less eager to define MATCH_MAY_ALLOCATE.
Diffstat (limited to 'src/regex.c')
-rw-r--r--src/regex.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/regex.c b/src/regex.c
index bd9ad6f6972..0cfd4969982 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -898,8 +898,8 @@ static const char *re_error_msg[] =
ralloc heap) shift the data out from underneath the regexp
routines.
- Here's another reason to avoid allocation: Emacs insists on
- processing input from X in a signal handler; processing X input may
+ Here's another reason to avoid allocation: Emacs
+ processes input from X in a signal handler; processing X input may
call malloc; if input arrives while a matching routine is calling
malloc, then we're scrod. But Emacs can't just block input while
calling matching routines; then we don't notice interrupts when
@@ -910,8 +910,9 @@ static const char *re_error_msg[] =
/* Normally, this is fine. */
#define MATCH_MAY_ALLOCATE
-/* But under some circumstances, it's not. */
-#if defined (emacs) || (defined (REL_ALLOC) && defined (C_ALLOCA))
+/* The match routines may not allocate if (1) they would do it with malloc
+ and (2) it's not safe for htem to use malloc. */
+#if (defined (C_ALLOCA) || defined (REGEX_MALLOC)) && (defined (emacs) || defined (REL_ALLOC))
#undef MATCH_MAY_ALLOCATE
#endif