summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2012-12-11 14:01:54 -0500
committerFather Chrysostomos <sprout@cpan.org>2012-12-11 16:23:59 -0800
commit4b1e7f06143ab88e9b000eed23ae71e75b7c24b8 (patch)
treeedc372a70959319a44c89afad2386c72286ec768 /sv.h
parentd2192f4f82773968f8eb344c3b3b3836b271aa06 (diff)
downloadperl-4b1e7f06143ab88e9b000eed23ae71e75b7c24b8.tar.gz
better POD for mg_get and SvGROW
SvGROW unconditionally derefs SvANY to check SvLEN. A crash occurs if the sv is SVt_NULL. Also mg_get uses SvMAGIC which also has the same problem. Rather than having people finding these properties out by trial and error, document them. There is no sense in adding type checks since these 2 calls have been had sv type restrictions since probably day 1 and for performance reason. Anyone who hit the restrictions would have either fixed their code immediately, or abandoned using XS. I observed someone abandoning XS in the field over these undocumented restrictions.
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sv.h b/sv.h
index bea0a2f9fc..e3c26731fe 100644
--- a/sv.h
+++ b/sv.h
@@ -2010,7 +2010,8 @@ has been loaded.
Expands the character buffer in the SV so that it has room for the
indicated number of bytes (remember to reserve space for an extra trailing
NUL character). Calls C<sv_grow> to perform the expansion if necessary.
-Returns a pointer to the character buffer.
+Returns a pointer to the character buffer. SV must be of type >= SVt_PV. One
+alternative is to call C<sv_grow> if you are not sure of the type of SV.
=cut
*/