Skip to content

Commit

Permalink
Document SvPV_shrink_to_cur
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Feb 1, 2021
1 parent 8c5e15d commit b883c14
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sv.h
Expand Up @@ -1400,6 +1400,15 @@ 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 unencumbered by things like COW. Using
C<SV_CHECK_THINKFIRST> or C<SV_CHECK_THINKFIRST_COW_DROP> before
calling this should clean it up.
=cut
*/

#define SvPV_shrink_to_cur(sv) STMT_START { \
const STRLEN _lEnGtH = SvCUR(sv) + 1; \
Expand Down

0 comments on commit b883c14

Please sign in to comment.