diff options
author | Karl Williamson <khw@cpan.org> | 2020-07-22 09:41:34 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-12-27 09:42:38 -0700 |
commit | cd188aff2b7442bf17858a475456a5031341a88c (patch) | |
tree | 302164e99018329e3ec6ca0500939b33c988cb7a /sv.h | |
parent | dba7cf2eab9433e2b03074d49e3473dfbf0d85b1 (diff) | |
download | perl-cd188aff2b7442bf17858a475456a5031341a88c.tar.gz |
Document SvPV_renew
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1383,6 +1383,17 @@ object type. Exposed to perl code via Internals::SvREADONLY(). STMT_START { assert(SvTYPE(sv) >= SVt_PV); \ SvCUR_set(sv, (val) - SvPVX(sv)); } STMT_END +/* +=for apidoc Am|void|SvPV_renew|SV* sv|STRLEN len +Low level micro optimization of C<L</SvGROW>>. It is generally better to use +C<SvGROW> instead. This is because C<SvPV_renew> ignores potential issues that +C<SvGROW> handles. C<sv> needs to have a real C<PV> that is unencombered by +things like COW. Using C<L</SV_CHECK_THINKFIRST>> or +C<L</SV_CHECK_THINKFIRST_COW_DROP>> before calling this should clean it up, but +why not just use C<SvGROW> if you're not sure about the provenance? + +=cut +*/ #define SvPV_renew(sv,n) \ STMT_START { SvLEN_set(sv, n); \ SvPV_set((sv), (MEM_WRAP_CHECK_(n,char) \ |