summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/getwc.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2009-01-17 18:57:12 +0000
committerdas <das@FreeBSD.org>2009-01-17 18:57:12 +0000
commit95d0f36c7589f4674ec6bdd3e5e7075247e07bc4 (patch)
tree1e32396dc83190cc960f9935ff254284b72ecf8a /lib/libc/stdio/getwc.c
parent2a7f0d1fff86c0eacbbae4bc7532f55da810c955 (diff)
downloadFreeBSD-src-95d0f36c7589f4674ec6bdd3e5e7075247e07bc4.zip
FreeBSD-src-95d0f36c7589f4674ec6bdd3e5e7075247e07bc4.tar.gz
When f[w]printf() is called on an unbuffered file like stdout, it
sets up a fake buffered FILE and then effectively calls itself recursively. Unfortunately, gcc doesn't know how to do tail call elimination in this case, and actually makes things worse by inlining __sbprintf(). This means that f[w]printf() to stderr was allocating about 5k of stack on 64-bit platforms, much of which was never used. I've reorganized things to eliminate the waste. In addition to saving some stack space, this improves performance in my tests by anywhere from 5% to 17% (depending on the test) when -fstack-protector is enabled. I found no statistically significant performance difference when stack protection is turned off. (The tests redirected stderr to /dev/null.)
Diffstat (limited to 'lib/libc/stdio/getwc.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud