# HG changeset patch # User Jim Blandy # Date 739716656 0 # Node ID 00fa1b757db871dc58ec119dbc6b27644526969b # Parent f37a9c897699a10297b8523df1688697bfa2b7c6 *** empty log message *** diff -r f37a9c897699 -r 00fa1b757db8 src/regex.c --- a/src/regex.c Thu Jun 10 12:18:36 1993 +0000 +++ b/src/regex.c Thu Jun 10 12:50:56 1993 +0000 @@ -881,13 +881,22 @@ using the relocating allocator routines, then malloc could cause a relocation, which might (if the strings being searched are in the ralloc heap) shift the data out from underneath the regexp - routines. */ + routines. + + Here's another reason to avoid allocation: Emacs insists on + processing 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 + they come in. So, Emacs blocks input around all regexp calls + except the matching calls, which it leaves unprotected, in the + faith that they will not malloc. */ /* Normally, this is fine. */ #define MATCH_MAY_ALLOCATE /* But under some circumstances, it's not. */ -#if defined (REL_ALLOC) && defined (C_ALLOCA) +#if defined (emacs) || (defined (REL_ALLOC) && defined (C_ALLOCA)) #undef MATCH_MAY_ALLOCATE #endif