diff options
author | 2013-06-07 01:01:34 +0000 | |
---|---|---|
committer | 2013-06-07 01:01:34 +0000 | |
commit | e5bff5e430c392e3c6a319145c5d7887c8b72c8e (patch) | |
tree | cb4309093275c3efec305ac210d79f2c78c2a252 /mdoc_macro.c | |
parent | 16c0e4b5b5dbe4e742237f62abe437332875589b (diff) | |
download | mandoc-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 'mdoc_macro.c')
0 files changed, 0 insertions, 0 deletions