]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
unifdef(1): Improve worst-case bound on symbol resolution
authorConrad Meyer <cem@FreeBSD.org>
Tue, 19 Nov 2019 04:30:23 +0000 (04:30 +0000)
committerConrad Meyer <cem@FreeBSD.org>
Tue, 19 Nov 2019 04:30:23 +0000 (04:30 +0000)
commit82e14014a3ac61a15ddc3f8d1a6f2855a538359a
tree31e5490493bcef42567d93420f3d19dc19560fcf
parent55fa224bd1eeb3cdd65b4b90a224c67406d36876
unifdef(1): Improve worst-case bound on symbol resolution

Use RB_TREE to make some algorithms O(lg N) and O(N lg N) instead of O(N)
and O(N^2).  Because N is typically small and the former linear array also has
great constant factors (as a property of CPU caching), this doesn't provide
material benefit most or all of the time.

While here, remove arbitrarily limit on number of macros understood.
usr.bin/unifdef/unifdef.c