This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_sv_vcatpvfn_flags: better calc f/p buf size
How it works out the needed buffer size for the various floating point
formats is a bit opaque. This commit extensively documents and
rationalises the process. In particular it will no longer allocate a very
large buffer for %g printing a large number (%g switches to %e style
format rather than %f in cases like this). Also it no longer relies on a
+40 fudge factor to accommodate exponents - this is now factored in
properly.
It still includes a +20 safety fudge factor for production builds, but
this is disabled under DEBUGGING so that ASAN and the like are likely to
more quickly spot issues during development.