Skip to content

Commit 4a38ddc

Browse files
committed
Perldelta for Perl_expected_size / SvPV_shrink_to_cur
1 parent d999021 commit 4a38ddc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pod/perldelta.pod

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,26 @@ well.
398398
Removed the deprecated (since 5.32) functions C<sv_locking()> and
399399
C<sv_unlocking>.
400400

401+
=item *
402+
403+
C<Perl_expected_size> has been added as an experimental stub macro. The
404+
intention is to build on this such that it can be passed a size in bytes,
405+
then returns the interpreter's best informed guess of what actual usable
406+
allocation size would be returned by the malloc implementation in use.
407+
408+
This would help with sizing allocations such that SvLEN is more accurate
409+
and not trying to shrink string buffers to save size when the intended
410+
saving is unrealistic.
411+
412+
=item *
413+
414+
C<SvPV_shrink_to_cur> has been revised to include a byte for COW, so that
415+
the resulting string could be COWed in the future.
416+
417+
It also now uses C<Perl_expected_size>, compared against the current
418+
buffer size, and does not try to do a reallocation if the requested
419+
memory saving is unrealistic.
420+
401421
=back
402422

403423
=head1 Selected Bug Fixes

0 commit comments

Comments
 (0)