Cache regex compilation for another autoconf speedup.
commit10f18604f16b6dc60803230289a02151abf9c778
authorEric Blake <ebb9@byu.net>
Tue, 9 Oct 2007 14:31:33 +0000 (9 08:31 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 9 Oct 2007 15:42:18 +0000 (9 09:42 -0600)
tree00a81dc09668b7c59e05e98a3189d8339ddebe32
parent3be7d5f421c547a2118a4fc703c37ff648b55c55
Cache regex compilation for another autoconf speedup.

* src/m4.h (free_macro_sequence): Rename...
(free_regex): ...to this.
* src/m4.c (main): Update caller.
* src/builtin.c (REGEX_CACHE_SIZE, m4_regex, regex_cache): New
declarations.
(compile_pattern): New function; cache recent regexes.
(free_regex): Rename, and clean up additional memory.
(m4_regexp, m4_patsubst): Use new function.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
src/builtin.c
src/m4.c
src/m4.h