# HG changeset patch # User Richard M. Stallman # Date 773393105 0 # Node ID 66a5487be3a76a98af38b623983ea44056397e81 # Parent e3859c43c6f4aae7387ae306c9135a869634cd58 Be less eager to define MATCH_MAY_ALLOCATE. diff -r e3859c43c6f4 -r 66a5487be3a7 src/regex.c --- a/src/regex.c Tue Jul 05 07:24:16 1994 +0000 +++ b/src/regex.c Tue Jul 05 07:25:05 1994 +0000 @@ -898,8 +898,8 @@ 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 @@ /* 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