From: Nicholas Clark Date: Sun, 31 Oct 2004 12:24:09 +0000 (+0000) Subject: Set the IV values for PL_sv_yes and PL_sv_no at initialisation time. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0309f36e4df1c9e72102c33e0035b9cae83fb872;p=p5sagit%2Fp5-mst-13.2.git Set the IV values for PL_sv_yes and PL_sv_no at initialisation time. p4raw-id: //depot/perl@23445 --- diff --git a/perl.c b/perl.c index 33d7dfb..65b02a0 100644 --- a/perl.c +++ b/perl.c @@ -237,11 +237,15 @@ perl_construct(pTHXx) 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. */ + SvIV(&PL_sv_no); SvNV(&PL_sv_no); SvREADONLY_on(&PL_sv_no); SvREFCNT(&PL_sv_no) = (~(U32)0)/2; sv_setpv(&PL_sv_yes,PL_Yes); + SvIV(&PL_sv_yes); SvNV(&PL_sv_yes); SvREADONLY_on(&PL_sv_yes); SvREFCNT(&PL_sv_yes) = (~(U32)0)/2; diff --git a/sv.c b/sv.c index 69b9e2e..43620e9 100644 --- a/sv.c +++ b/sv.c @@ -11620,19 +11620,23 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, SvANY(&PL_sv_no) = new_XPVNV(); SvREFCNT(&PL_sv_no) = (~(U32)0)/2; - SvFLAGS(&PL_sv_no) = SVp_NOK|SVf_NOK|SVp_POK|SVf_POK|SVf_READONLY|SVt_PVNV; + SvFLAGS(&PL_sv_no) = SVp_IOK|SVf_IOK|SVp_NOK|SVf_NOK + |SVp_POK|SVf_POK|SVf_READONLY|SVt_PVNV; SvPVX(&PL_sv_no) = SAVEPVN(PL_No, 0); SvCUR(&PL_sv_no) = 0; SvLEN(&PL_sv_no) = 1; + SvIVX(&PL_sv_no) = 0; SvNVX(&PL_sv_no) = 0; ptr_table_store(PL_ptr_table, &proto_perl->Isv_no, &PL_sv_no); SvANY(&PL_sv_yes) = new_XPVNV(); SvREFCNT(&PL_sv_yes) = (~(U32)0)/2; - SvFLAGS(&PL_sv_yes) = SVp_NOK|SVf_NOK|SVp_POK|SVf_POK|SVf_READONLY|SVt_PVNV; + SvFLAGS(&PL_sv_yes) = SVp_IOK|SVf_IOK|SVp_NOK|SVf_NOK + |SVp_POK|SVf_POK|SVf_READONLY|SVt_PVNV; SvPVX(&PL_sv_yes) = SAVEPVN(PL_Yes, 1); SvCUR(&PL_sv_yes) = 1; SvLEN(&PL_sv_yes) = 2; + SvIVX(&PL_sv_yes) = 1; SvNVX(&PL_sv_yes) = 1; ptr_table_store(PL_ptr_table, &proto_perl->Isv_yes, &PL_sv_yes);