Branch: refs/heads/blead
Home: https://github.com/Perl/perl5
Commit: a52129cfe6e2f56cb2f67675fc9370b10494e2af
https://github.com/Perl/perl5/commit/a52129cfe6e2f56cb2f67675fc9370b10494e2af
Author: Richard Leach <[email protected]>
Date: 2026-02-16 (Mon, 16 Feb 2026)
Changed paths:
M op.c
M pod/perldelta.pod
M t/perf/opcount.t
Log Message:
-----------
Add a folding limit on the size of the string repetition multiplier
Historically, given a statement like `my $x = "A" x SOMECONSTANT;`, no
examination of the size of the multiplier (`SOMECONSTANT` in this example)
was done at compile time. Depending upon the constant folding behaviour,
this might mean:
* The buffer allocation needed at runtime could be clearly bigger than
the system can support, but Perl would happily compile the statement
and let the author find this out at runtime.
* Constants resulting from folding could be very large and the memory
taken up undesirable, especially in cases where the constant resides
in cold code.
This commit addresses the second case by adding a folding threshold for
constant multipliers.
To unsubscribe from these emails, change your notification settings at
https://github.com/Perl/perl5/settings/notifications