Skip to content

Commit d28bcf5

Browse files
committed
Perldelta for Perl_expected_size / SvPV_shrink_to_cur
1 parent 4393fb4 commit d28bcf5

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
@@ -350,6 +350,26 @@ well.
350350

351351
XXX
352352

353+
=item *
354+
355+
C<Perl_expected_size> has been added as an experimental stub macro. The
356+
intention is to build on this such that it can be passed a size in bytes,
357+
then returns the interpreter's best informed guess of what actual usable
358+
allocation size would be returned by the malloc implementation in use.
359+
360+
This would help with sizing allocations such that SvLEN is more accurate
361+
and not trying to shrink string buffers to save size when the intended
362+
saving is unrealistic.
363+
364+
=item *
365+
366+
C<SvPV_shrink_to_cur> has been revised to include a byte for COW, so that
367+
the resulting string could be COWed in the future.
368+
369+
It also now uses C<Perl_expected_size>, compared against the current
370+
buffer size, and does not try to do a reallocation if the requested
371+
memory saving is unrealistic.
372+
353373
=back
354374

355375
=head1 Selected Bug Fixes

0 commit comments

Comments
 (0)