[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/search.c,v
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] Changes to emacs/src/search.c,v |
Date: |
Sun, 17 Sep 2006 17:39:00 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Chong Yidong <cyd> 06/09/17 17:38:59
Index: search.c
===================================================================
RCS file: /sources/emacs/emacs/src/search.c,v
retrieving revision 1.212
retrieving revision 1.213
diff -u -b -r1.212 -r1.213
--- search.c 8 Sep 2006 12:07:07 -0000 1.212
+++ search.c 17 Sep 2006 17:38:59 -0000 1.213
@@ -207,6 +207,19 @@
}
}
+/* Clear the regexp cache.
+ There is no danger of memory leak here because re_compile_pattern
+ automagically manages the memory in each re_pattern_buffer struct,
+ based on its `allocated' and `buffer' values. */
+void
+clear_regexp_cache ()
+{
+ int i;
+
+ for (i = 0; i < REGEXP_CACHE_SIZE; ++i)
+ searchbufs[i].regexp = Qnil;
+}
+
/* Compile a regexp if necessary, but first check to see if there's one in
the cache.
PATTERN is the pattern to compile.