diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-06-07 01:01:34 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-06-07 01:01:34 +0000 |
commit | abcea2e84eb36a5071348b5e3d32d407411200b5 (patch) | |
tree | 07d68e0a4d478f871892e9d08889442ef32c008f /msec.c | |
parent | e954e8f25cbcd0ac5a7b94cfbbbaa85047cd5c7c (diff) | |
download | mandoc-abcea2e84eb36a5071348b5e3d32d407411200b5.tar.gz |
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 'msec.c')
0 files changed, 0 insertions, 0 deletions