diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-02-18 19:40:43 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-02-18 19:40:43 +0000 |
commit | b9f83d2f7c4cb24d96302c6fcaa5e60628fad1f8 (patch) | |
tree | 65417bf74a7dc6b1ad198dcf0f64abbe38d16a66 /perl.c | |
parent | be2b1c742382f74864880924170180bbe1904463 (diff) | |
download | perl-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.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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; |