diff options
author | Karl Williamson <khw@cpan.org> | 2022-05-20 10:06:04 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-05-27 21:24:12 -0600 |
commit | e76506c9659e52bc10b6190aebe32f079f5fccc0 (patch) | |
tree | 7f3d9218d97939ac21d82ab235e86902a2b3dad8 /sv.h | |
parent | 2bf695bea7e58f1b998f32cc43c9df6f94fee169 (diff) | |
download | perl-e76506c9659e52bc10b6190aebe32f079f5fccc0.tar.gz |
perlapi: Document SvPV_shrink_to_cur
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1490,6 +1490,19 @@ why not just use C<SvGROW> if you're not sure about the provenance? (char*)saferealloc((Malloc_t)SvPVX(sv), \ (MEM_SIZE)((n))))); \ } STMT_END +/* +=for apidoc Am|void|SvPV_shrink_to_cur|SV* sv + +Trim any trailing unused memory in the PV of C<sv>, which needs to have a real +C<PV> that is unencombered by things like COW. Think first before using this +functionality. Is the space saving really worth giving up COW? Will the +needed size of C<sv> stay the same? + +If the answers are both yes, then use C<SV_CHECK_THINKFIRST> or +C<SV_CHECK_THINKFIRST_COW_DROP> before calling this. + +=cut +*/ #define SvPV_shrink_to_cur(sv) STMT_START { \ const STRLEN _lEnGtH = SvCUR(sv) + 1; \ |