summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@pobox.com>2012-07-23 22:40:46 -0700
committerChip Salzenberg <chip@pobox.com>2012-07-23 22:40:46 -0700
commit0d96b528ff0140192b273a677f66f80ee54f3fc4 (patch)
tree54f57dd97d20c6084caf3d35769ad88110c07106 /perl.c
parent42200cde60ed56f4d6789811978497edc397a4a9 (diff)
downloadperl-0d96b528ff0140192b273a677f66f80ee54f3fc4.tar.gz
Unify code that initializes constants yes, no, and undef
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/perl.c b/perl.c
index a4a05f5a07..bba4688ab2 100644
--- a/perl.c
+++ b/perl.c
@@ -242,29 +242,7 @@ perl_construct(pTHXx)
#endif
PL_curcop = &PL_compiling; /* needed by ckWARN, right away */
- /* set read-only and try to insure than we wont see REFCNT==0
- very often */
-
- SvREADONLY_on(&PL_sv_undef);
- SvREFCNT(&PL_sv_undef) = (~(U32)0)/2;
-
- sv_setpv(&PL_sv_no,PL_No);
- /* value lookup in void context - happens to have the side effect
- of caching the numeric forms. However, as &PL_sv_no doesn't contain
- a string that is a valid numer, we have to turn the public flags by
- hand: */
- SvNV(&PL_sv_no);
- SvIV(&PL_sv_no);
- SvIOK_on(&PL_sv_no);
- SvNOK_on(&PL_sv_no);
- SvREADONLY_on(&PL_sv_no);
- SvREFCNT(&PL_sv_no) = (~(U32)0)/2;
-
- sv_setpv(&PL_sv_yes,PL_Yes);
- SvNV(&PL_sv_yes);
- SvIV(&PL_sv_yes);
- SvREADONLY_on(&PL_sv_yes);
- SvREFCNT(&PL_sv_yes) = (~(U32)0)/2;
+ init_constants();
SvREADONLY_on(&PL_sv_placeholder);
SvREFCNT(&PL_sv_placeholder) = (~(U32)0)/2;