This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Microoptimize regex, take 2
2004-03-24 Paolo Bonzini <firstname.lastname@example.org>
* posix/regex_internal.c (free_state): Free the
word_trtable if it is used.
(re_string_reconstruct, re_string_context_at): Add
several branch predictions for case-sensitive
matching and for no transition table being used.
* posix/regex_internal.h (re_dfastate_t): Turn the
word_trtable from a 1-bit flag into a pointer to a
* posix/regexec.c (acquire_init_state_context): Do not
* posix/regexec.c (build_trtable): Store the transition
table into state. Return a boolean indicating success.
(transit_state): Check trtable and word_trtable separately,
instead of looking into word_trtable for information about
the trtable's contents. Remove the check for out-of-bounds
(check_matching): Check here for out-of-bounds buffers.
(match_ctx_free_subtops): Remove, merge into...
(match_ctx_clean): ... this function.
(match_ctx_free): Call match_ctx_clean.
(re_search_internal): Store into match_kind a set of bits
indicating which incantation of fastmap scanning must be
used. Use a switch statement instead of multiple ifs.
Exit the final "for (;;)" with goto free_return unless
the match succeeded, thus simplifying some conditionals.
This mail sent through IMP: http://horde.org/imp/