summaryrefslogtreecommitdiffhomepage
path: root/src/vector.h
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-09-05 19:32:21 +0100
committerrofl0r <rofl0r@users.noreply.github.com>2020-09-05 19:42:34 +0100
commit233ce6de3b4a23f44c0e8a1acdc76cc98be00358 (patch)
treefd44a597f56b7be28851b6772c61ab059d4f0b6a /src/vector.h
parentc4dc3ba007fe34d6b7704ffb5ec812a436c326e7 (diff)
filter: reduce memory usage, fix OOM crashes
* check return values of memory allocation and abort gracefully in out-of-memory situations * use sblist (linear dynamic array) instead of linked list - this removes one pointer per filter rule - removes need to manually allocate/free every single list item (instead block allocation is used) - simplifies code * remove storage of (unused) input rule - removes one char* pointer per filter rule - removes storage of the raw bytes of each filter rule * add line number to display on out-of-memory/invalid regex situation * replace duplicate filter_domain()/filter_host() code with a single function filter_run() - reduces code size and management effort with these improvements, >1 million regex rules can be loaded with 4 GB of RAM, whereas previously it crashed with about 950K. the list for testing was assembled from http://www.shallalist.de/Downloads/shallalist.tar.gz closes #20
Diffstat (limited to 'src/vector.h')
0 files changed, 0 insertions, 0 deletions