diff options
| author | Chong Yidong | 2006-09-17 17:38:59 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-09-17 17:38:59 +0000 |
| commit | e5b94d44df00cfc40845d4000796d419b123a1a7 (patch) | |
| tree | b37146f4c754bc9513c1ecb5598e787a3b128fa9 /src | |
| parent | db70f3afa3126edd6f2df516892f0103c39ff9f7 (diff) | |
| download | emacs-e5b94d44df00cfc40845d4000796d419b123a1a7.tar.gz emacs-e5b94d44df00cfc40845d4000796d419b123a1a7.zip | |
* search.c (clear_regexp_cache): New function.
* syntax.c (Fmodify_syntax_entry): Clear regexp cache.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/search.c | 13 | ||||
| -rw-r--r-- | src/syntax.c | 5 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9b74ac1ed89..a205a9cc6c3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2006-09-17 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * search.c (clear_regexp_cache): New function. | ||
| 4 | |||
| 5 | * syntax.c (Fmodify_syntax_entry): Clear regexp cache. | ||
| 6 | |||
| 1 | 2006-09-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 7 | 2006-09-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 8 | ||
| 3 | * gtkutil.c (xg_get_file_with_chooser): Check | 9 | * gtkutil.c (xg_get_file_with_chooser): Check |
diff --git a/src/search.c b/src/search.c index 2063e7d95ba..8b469a37b70 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -207,6 +207,19 @@ shrink_regexp_cache () | |||
| 207 | } | 207 | } |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | /* Clear the regexp cache. | ||
| 211 | There is no danger of memory leak here because re_compile_pattern | ||
| 212 | automagically manages the memory in each re_pattern_buffer struct, | ||
| 213 | based on its `allocated' and `buffer' values. */ | ||
| 214 | void | ||
| 215 | clear_regexp_cache () | ||
| 216 | { | ||
| 217 | int i; | ||
| 218 | |||
| 219 | for (i = 0; i < REGEXP_CACHE_SIZE; ++i) | ||
| 220 | searchbufs[i].regexp = Qnil; | ||
| 221 | } | ||
| 222 | |||
| 210 | /* Compile a regexp if necessary, but first check to see if there's one in | 223 | /* Compile a regexp if necessary, but first check to see if there's one in |
| 211 | the cache. | 224 | the cache. |
| 212 | PATTERN is the pattern to compile. | 225 | PATTERN is the pattern to compile. |
diff --git a/src/syntax.c b/src/syntax.c index eee9151f878..052191d5fef 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -1039,6 +1039,11 @@ usage: (modify-syntax-entry CHAR NEWENTRY &optional SYNTAX-TABLE) */) | |||
| 1039 | check_syntax_table (syntax_table); | 1039 | check_syntax_table (syntax_table); |
| 1040 | 1040 | ||
| 1041 | SET_RAW_SYNTAX_ENTRY (syntax_table, XINT (c), Fstring_to_syntax (newentry)); | 1041 | SET_RAW_SYNTAX_ENTRY (syntax_table, XINT (c), Fstring_to_syntax (newentry)); |
| 1042 | |||
| 1043 | /* We clear the regexp cache, since character classes can now have | ||
| 1044 | different values from those in the compiled regexps.*/ | ||
| 1045 | clear_regexp_cache (); | ||
| 1046 | |||
| 1042 | return Qnil; | 1047 | return Qnil; |
| 1043 | } | 1048 | } |
| 1044 | 1049 | ||