summaryrefslogtreecommitdiff
path: root/perl.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 /perl.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 'perl.c')
-rw-r--r--perl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/perl.c b/perl.c
index 7a53b72e74..4dfea50763 100644
--- a/perl.c
+++ b/perl.c
@@ -2133,8 +2133,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
}
}
- PL_main_cv = PL_compcv = (CV*)newSV(0);
- sv_upgrade((SV *)PL_compcv, SVt_PVCV);
+ PL_main_cv = PL_compcv = (CV*)newSV_type(SVt_PVCV);
CvUNIQUE_on(PL_compcv);
CvPADLIST(PL_compcv) = pad_new(0);
@@ -4645,11 +4644,9 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register
dVAR;
GV* tmpgv;
- PL_toptarget = newSV(0);
- sv_upgrade(PL_toptarget, SVt_PVFM);
+ PL_toptarget = newSV_type(SVt_PVFM);
sv_setpvn(PL_toptarget, "", 0);
- PL_bodytarget = newSV(0);
- sv_upgrade(PL_bodytarget, SVt_PVFM);
+ PL_bodytarget = newSV_type(SVt_PVFM);
sv_setpvn(PL_bodytarget, "", 0);
PL_formtarget = PL_bodytarget;