2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 14:25:52 +00:00

Cleanup the perm_map as soon as it is no longer needed. Cleaning up the map

before the end of the functions reduces the peak memory of the function
This commit is contained in:
John Johansen
2010-11-09 11:26:18 -08:00
parent 2fb64fa85e
commit c2601dbd30

View File

@@ -1745,6 +1745,11 @@ void DFA::minimize(dfaflags_t flags)
cerr << "\033[2KMinimize dfa: partitions " << partitions.size() << "\tinit " << partitions.size() << "\t(accept " << accept_count << ")\r";
}
/* perm_map is no longer needed so free the memory it is using.
* Don't remove - doing it manually here helps reduce peak memory usage.
*/
perm_map.clear();
int init_count = partitions.size();
if (flags & DFA_DUMP_PROGRESS)
cerr << "\033[2KMinimize dfa: partitions " << partitions.size() << "\tinit " << init_count << "\t(accept " << accept_count << ")\r";