mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
When creating the dfa the sets firstpos, lastpos, and followpos are computed for
each expression tree node and then used as input to create the dfa states. Currently they are not being freed until the nodes are destroyed, but the information is no longer needed once the dfa has been created. Cleaning them up early reduces peak memory usage.
This commit is contained in:
parent
da6df9fdc5
commit
1004f039ec
1 changed files with 7 additions and 0 deletions
|
@ -1370,6 +1370,13 @@ DFA::DFA(Node *root, dfaflags_t flags) : root(root)
|
||||||
here.cases.insert(*j);
|
here.cases.insert(*j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (depth_first_traversal i(root); i; i++) {
|
||||||
|
(*i)->firstpos.clear();
|
||||||
|
(*i)->lastpos.clear();
|
||||||
|
(*i)->followpos.clear();
|
||||||
|
}
|
||||||
|
|
||||||
if (flags & (DFA_DUMP_STATS))
|
if (flags & (DFA_DUMP_STATS))
|
||||||
fprintf(stderr, "\033[2KCreated dfa: states %ld\tmatching %d\tnonmatching %d\n", states.size(), match_count, nomatch_count);
|
fprintf(stderr, "\033[2KCreated dfa: states %ld\tmatching %d\tnonmatching %d\n", states.size(), match_count, nomatch_count);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue