From 7ba26d48121ff365601a73eefc7798693a3a9118 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 3 Dec 2011 11:02:32 -0800 Subject: [PATCH] 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. --- sv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sv.c b/sv.c index 0aebda2..ae97f1d 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 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 should point to memory that was allocated -by C. The string length, C, must be supplied. By default +by C. It must be the start of a mallocked block +of memory, and not a pointer to the middle of it. The +string length, C, must be supplied. By default this function will realloc (i.e. move) the memory pointed to by C, 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" -- 2.7.4