summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-07-19 21:47:40 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-07-19 21:47:40 -0700
commit818a1eea1a9bb0b9ffb67398143bb9e562804316 (patch)
treeaaac5c57ba6081b5da18cb16f98a26643b9eeaea /struct.c
parent91ecae23d0879bad3cac1070dd6e32d2aff7855a (diff)
downloadtxr-818a1eea1a9bb0b9ffb67398143bb9e562804316.tar.gz
txr-818a1eea1a9bb0b9ffb67398143bb9e562804316.tar.bz2
txr-818a1eea1a9bb0b9ffb67398143bb9e562804316.zip
NFA regex optimization: use just one set array.
We don't have to flip between two arrays, since the nfa_closure and and nfa_move_closure can write the output set into the same array. * regex.c (struct nfa_machine): Replace flip and flop members with a single set. (nfa_closure, nfa_move_closure): out array parameter removed; in renamed to set. References to in and out simply replaced with set. (nfa_run): Allocate one set instead of two, plus the stack. Remove code to swap the two pointers on each iteration. (regex_machine_reset): Prepare initial closure in the one and only set array. (regex_machine_init): Allocate set array, rather than flip an flop. (regex_machine_cleanup): Free set array and null out pointer rather than flip and flop arrays. (regex_machine_feed): Pass just the set ot the nfa_move_closure function. Remove flip/flop pointer swapping
Diffstat (limited to 'struct.c')
0 files changed, 0 insertions, 0 deletions