musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/stdio/getc.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012年10月25日 15:40:58 -0400
committerRich Felker <dalias@aerifal.cx>2012年10月25日 15:40:58 -0400
commit607b05aca683eee5bcdb7bf9af4ebf02adc635d9 (patch)
tree34c9c2435269738bb8d489346ea5e388b14dd850 /src/stdio/getc.c
parent80a45458e0d9b75d508110bd880d0ae0432b0356 (diff)
downloadmusl-607b05aca683eee5bcdb7bf9af4ebf02adc635d9.tar.gz
use explicit visibility to optimize a few hot-path function calls
on x86 and some other archs, functions which make function calls which might go through a PLT incur a significant overhead cost loading the GOT register prior to making the call. this load is utterly useless in musl, since all calls are bound at library-creation time using -Bsymbolic-functions, but the compiler has no way of knowing this, and attempts to set the default visibility to protected have failed due to bugs in GCC and binutils. this commit simply manually assigns hidden/protected visibility, as appropriate, to a few internal-use-only functions which have many callers, or which have callers that are hot paths like getc/putc. it shaves about 5k off the i386 libc.so with -Os. many of the improvements are in syscall wrappers, where the benefit is just size and performance improvement is unmeasurable noise amid the syscall overhead. however, stdio may be measurably faster. if in the future there are toolchains that can do the same thing globally without introducing linking bugs, it might be worth considering removing these workarounds.
Diffstat (limited to 'src/stdio/getc.c')
0 files changed, 0 insertions, 0 deletions
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月28日 02:25:18 +0000

AltStyle によって変換されたページ (->オリジナル) /