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/signal/sigaltstack.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2024年08月26日 16:01:11 -0400
committerRich Felker <dalias@aerifal.cx>2024年08月26日 16:01:11 -0400
commit572a2e2eb91f00f2f25d301cfb50f435e7ae16b3 (patch)
tree08c826277b16d6e70b983f9e9b8cc103eeec23d1 /src/signal/sigaltstack.c
parentc94a0c16f08894ce3be6dafb0fe80baa77a6ff2a (diff)
downloadmusl-572a2e2eb91f00f2f25d301cfb50f435e7ae16b3.tar.gz
printf: drastically reduce stack usage without [long] double args
internally, printf always works with the maximal-size supported integer and floating point formats. however, the space needed to format a floating point number is proportional to the mantissa and exponent ranges. on archs where long double is larger than double, knowing that the actual value fit in double allows us to use a much smaller buffer, roughly 1/16 the size. as a bonus, making the working buffer a VLA whose dimension depends on the format specifier prevents the compiler from lifting the stack adjustment to the top of printf_core. this makes it so printf calls without floating point arguments do not waste even the smaller amount of stack space needed for double, making it much more practical to use printf in tightly stack-constrained environments.
Diffstat (limited to 'src/signal/sigaltstack.c')
0 files changed, 0 insertions, 0 deletions
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月25日 14:32:55 +0000

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