From 615e0a48731ea26b42cfaf932fb88fd71387df37 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Tue, 4 Dec 2012 21:59:07 -0800 Subject: [PATCH] toke.c apidocs: Note that scan_vstring might croak --- toke.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/toke.c b/toke.c index b60d720..7b6f194 100644 --- 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 * -- 2.7.4