summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-02-18 19:40:43 +0000
committerNicholas Clark <nick@ccl4.org>2007-02-18 19:40:43 +0000
commitb9f83d2f7c4cb24d96302c6fcaa5e60628fad1f8 (patch)
tree65417bf74a7dc6b1ad198dcf0f64abbe38d16a66 /gv.c
parentbe2b1c742382f74864880924170180bbe1904463 (diff)
downloadperl-b9f83d2f7c4cb24d96302c6fcaa5e60628fad1f8.tar.gz
Add a new API function newSV_type, to replace the idiom:
sv = newSV(0); sv_upgrade(sv, type); p4raw-id: //depot/perl@30347
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gv.c b/gv.c
index 475c225b22..3e428a7700 100644
--- a/gv.c
+++ b/gv.c
@@ -1354,9 +1354,7 @@ Perl_newIO(pTHX)
{
dVAR;
GV *iogv;
- IO * const io = (IO*)newSV(0);
-
- sv_upgrade((SV *)io,SVt_PVIO);
+ IO * const io = (IO*)newSV_type(SVt_PVIO);
/* This used to read SvREFCNT(io) = 1;
It's not clear why the reference count needed an explicit reset. NWC
*/