toke.c apidocs: Note that scan_vstring might croak
authorFather Chrysostomos <sprout@cpan.org>
Wed, 5 Dec 2012 05:59:07 +0000 (21:59 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 5 Dec 2012 17:36:09 +0000 (09:36 -0800)
toke.c

diff --git a/toke.c b/toke.c
index b60d720..7b6f194 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -11537,13 +11537,18 @@ vstring, as well as updating the passed in sv.
 
 Function must be called like
 
-       sv = newSV(5);
+       sv = sv_2mortal(newSV(5));
        s = scan_vstring(s,e,sv);
 
 where s and e are the start and end of the string.
 The sv should already be large enough to store the vstring
 passed in, for performance reasons.
 
+This function may croak if fatal warnings are enabled in the
+calling scope, hence the sv_2mortal in the example (to prevent
+a leak).  Make sure to do SvREFCNT_inc afterwards if you use
+sv_2mortal.
+
 */
 
 char *