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 /toke.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 'toke.c')
-rw-r--r-- | toke.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -924,8 +924,7 @@ S_update_debugger_info(pTHX_ SV *orig_sv, const char *buf, STRLEN len) { AV *av = CopFILEAVx(PL_curcop); if (av) { - SV * const sv = newSV(0); - sv_upgrade(sv, SVt_PVMG); + SV * const sv = newSV_type(SVt_PVMG); if (orig_sv) sv_setsv(sv, orig_sv); else @@ -12385,8 +12384,7 @@ Perl_start_subparse(pTHX_ I32 is_format, U32 flags) save_item(PL_subname); SAVESPTR(PL_compcv); - PL_compcv = (CV*)newSV(0); - sv_upgrade((SV *)PL_compcv, is_format ? SVt_PVFM : SVt_PVCV); + PL_compcv = (CV*)newSV_type(is_format ? SVt_PVFM : SVt_PVCV); CvFLAGS(PL_compcv) |= flags; PL_subline = CopLINE(PL_curcop); |