diff options
| author | Jim Blandy | 1993-06-10 12:50:56 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-06-10 12:50:56 +0000 |
| commit | 85be31013c1b4dc8d624d051f6156dafcd336d36 (patch) | |
| tree | f0041e581d495bd307adc687936a102f360cd98e /src | |
| parent | ada464a7f3ffe0213d412196a14d9bb02e3531cb (diff) | |
| download | emacs-85be31013c1b4dc8d624d051f6156dafcd336d36.tar.gz emacs-85be31013c1b4dc8d624d051f6156dafcd336d36.zip | |
*** empty log message ***
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/regex.c b/src/regex.c index 4bb30f7e214..06c1bb0b72e 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -881,13 +881,22 @@ static const char *re_error_msg[] = | |||
| 881 | using the relocating allocator routines, then malloc could cause a | 881 | using the relocating allocator routines, then malloc could cause a |
| 882 | relocation, which might (if the strings being searched are in the | 882 | relocation, which might (if the strings being searched are in the |
| 883 | ralloc heap) shift the data out from underneath the regexp | 883 | ralloc heap) shift the data out from underneath the regexp |
| 884 | routines. */ | 884 | routines. |
| 885 | |||
| 886 | Here's another reason to avoid allocation: Emacs insists on | ||
| 887 | processing input from X in a signal handler; processing X input may | ||
| 888 | call malloc; if input arrives while a matching routine is calling | ||
| 889 | malloc, then we're scrod. But Emacs can't just block input while | ||
| 890 | calling matching routines; then we don't notice interrupts when | ||
| 891 | they come in. So, Emacs blocks input around all regexp calls | ||
| 892 | except the matching calls, which it leaves unprotected, in the | ||
| 893 | faith that they will not malloc. */ | ||
| 885 | 894 | ||
| 886 | /* Normally, this is fine. */ | 895 | /* Normally, this is fine. */ |
| 887 | #define MATCH_MAY_ALLOCATE | 896 | #define MATCH_MAY_ALLOCATE |
| 888 | 897 | ||
| 889 | /* But under some circumstances, it's not. */ | 898 | /* But under some circumstances, it's not. */ |
| 890 | #if defined (REL_ALLOC) && defined (C_ALLOCA) | 899 | #if defined (emacs) || (defined (REL_ALLOC) && defined (C_ALLOCA)) |
| 891 | #undef MATCH_MAY_ALLOCATE | 900 | #undef MATCH_MAY_ALLOCATE |
| 892 | #endif | 901 | #endif |
| 893 | 902 | ||