aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apropos.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-06-07 01:01:34 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-06-07 01:01:34 +0000
commite5bff5e430c392e3c6a319145c5d7887c8b72c8e (patch)
treecb4309093275c3efec305ac210d79f2c78c2a252 /apropos.c
parent16c0e4b5b5dbe4e742237f62abe437332875589b (diff)
downloadmandoc-e5bff5e430c392e3c6a319145c5d7887c8b72c8e.tar.gz
mandoc-e5bff5e430c392e3c6a319145c5d7887c8b72c8e.tar.zst
mandoc-e5bff5e430c392e3c6a319145c5d7887c8b72c8e.zip
The string hash table is only needed to combine multiple occurences
of the same string within the same manual, so initialize and purge it for each manual in ofmerge() instead of one single time in main(). There is no point in saving manual names and descriptions in that table because each of them occurs only once, or very few times. The is no point in saving section numbers there because they are so much shorter than the descriptions. Testing with the complete tree /usr/share/man/ on my notebook shows that this change slightly reduces memory consumption by about 20% while there is no measurable difference in execution time. As a bonus, this allows to delete the functions stradd() and stradds(), the "next" member from struct str, and the global struct str *words. While adapting the places in the code using stradd(), i noticed that parsing of the mdoc(7) .Nd macro was completely broken and that for formatted manual pages with unusable NAME section, the description was never set in the struct of. This commit fixes both bugs as well.
Diffstat (limited to 'apropos.c')
0 files changed, 0 insertions, 0 deletions