summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-12-03 11:02:32 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-12-04 10:50:48 -0800
commit7ba26d48121ff365601a73eefc7798693a3a9118 (patch)
treee3caea486f49abbe974083843f4af2f5260b75f0 /sv.c
parent5d4e58dcdb5d3b0a6dfc17071d845e7fc69ff071 (diff)
downloadperl-7ba26d48121ff365601a73eefc7798693a3a9118.tar.gz
Clarify docs for sv_usepvn_flags
Note that the string must be the start of a mallocked block of memory, and not a pointer to the middle of it.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 0aebda2f62..ae97f1d6a2 100644
--- a/sv.c
+++ b/sv.c
@@ -4606,7 +4606,9 @@ Perl_sv_sethek(pTHX_ register SV *const sv, const HEK *const hek)
Tells an SV to use C<ptr> to find its string value. Normally the
string is stored inside the SV but sv_usepvn allows the SV to use an
outside string. The C<ptr> should point to memory that was allocated
-by C<malloc>. The string length, C<len>, must be supplied. By default
+by C<malloc>. It must be the start of a mallocked block
+of memory, and not a pointer to the middle of it. The
+string length, C<len>, must be supplied. By default
this function will realloc (i.e. move) the memory pointed to by C<ptr>,
so that pointer should not be freed or used by the programmer after
giving it to sv_usepvn, and neither should any pointers from "behind"