summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-11-29 16:08:03 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-11-29 16:08:03 +0000
commit2d8e6c8d50eaf50f663a5fd184404c73944226e0 (patch)
treee5592e6ebd4ebedeee8ebc8ddbb60cad5f477fc4 /pp_ctl.c
parentb099ddc068b2498767e6f04ac167d9633b895ec4 (diff)
downloadperl-2d8e6c8d50eaf50f663a5fd184404c73944226e0.tar.gz
another threads reliability fix: serialize writes to thr->threadsv
avoid most uses of PL_na (which is much more inefficient than a simple local); update docs to suit; PL_na now being thr->Tna may be a minor compatibility issue for extensions--will require dTHR outside of XSUBs (those get automatic dTHR) p4raw-id: //depot/perl@2387
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index fbfcab5827..1cdf8bee90 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -872,10 +872,11 @@ PP(pp_sort)
if (*up = *++MARK) { /* Weed out nulls. */
SvTEMP_off(*up);
if (!PL_sortcop && !SvPOK(*up)) {
+ STRLEN n_a;
if (SvAMAGIC(*up))
overloading = 1;
else
- (void)sv_2pv(*up, &PL_na);
+ (void)sv_2pv(*up, &n_a);
}
up++;
}
@@ -1006,11 +1007,11 @@ PP(pp_flop)
}
else {
SV *final = sv_mortalcopy(right);
- STRLEN len;
+ STRLEN len, n_a;
char *tmps = SvPV(final, len);
sv = sv_mortalcopy(left);
- SvPV_force(sv,PL_na);
+ SvPV_force(sv,n_a);
while (!SvNIOKp(sv) && SvCUR(sv) <= len) {
XPUSHs(sv);
if (strEQ(SvPVX(sv),tmps))
@@ -1233,6 +1234,7 @@ OP *
die_where(char *message)
{
dSP;
+ STRLEN n_a;
if (PL_in_eval) {
I32 cxix;
register PERL_CONTEXT *cx;
@@ -1268,7 +1270,7 @@ die_where(char *message)
sv_setpv(ERRSV, message);
}
else
- message = SvPVx(ERRSV, PL_na);
+ message = SvPVx(ERRSV, n_a);
while ((cxix = dopoptoeval(cxstack_ix)) < 0 && PL_curstackinfo->si_prev) {
dounwind(-1);
@@ -1295,14 +1297,14 @@ die_where(char *message)
LEAVE;
if (optype == OP_REQUIRE) {
- char* msg = SvPVx(ERRSV, PL_na);
+ char* msg = SvPVx(ERRSV, n_a);
DIE("%s", *msg ? msg : "Compilation failed in require");
}
return pop_return();
}
}
if (!message)
- message = SvPVx(ERRSV, PL_na);
+ message = SvPVx(ERRSV, n_a);
PerlIO_printf(PerlIO_stderr(), "%s",message);
PerlIO_flush(PerlIO_stderr());
my_failure_exit();
@@ -1480,11 +1482,12 @@ PP(pp_reset)
{
djSP;
char *tmps;
+ STRLEN n_a;
if (MAXARG < 1)
tmps = "";
else
- tmps = POPp;
+ tmps = POPpx;
sv_reset(tmps, PL_curcop->cop_stash);
PUSHs(&PL_sv_yes);
RETURN;
@@ -1940,6 +1943,7 @@ PP(pp_goto)
label = 0;
if (PL_op->op_flags & OPf_STACKED) {
SV *sv = POPs;
+ STRLEN n_a;
/* This egregious kludge implements goto &subroutine */
if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVCV) {
@@ -2189,7 +2193,7 @@ PP(pp_goto)
}
}
else
- label = SvPV(sv,PL_na);
+ label = SvPV(sv,n_a);
}
else if (PL_op->op_flags & OPf_SPECIAL) {
if (! do_dump)
@@ -2338,7 +2342,8 @@ PP(pp_cswitch)
if (PL_multiline)
PL_op = PL_op->op_next; /* can't assume anything */
else {
- match = *(SvPVx(GvSV(cCOP->cop_gv), PL_na)) & 255;
+ STRLEN n_a;
+ match = *(SvPVx(GvSV(cCOP->cop_gv), n_a)) & 255;
match -= cCOP->uop.scop.scop_offset;
if (match < 0)
match = 0;
@@ -2577,6 +2582,7 @@ doeval(int gimme, OP** startop)
I32 gimme;
PERL_CONTEXT *cx;
I32 optype = 0; /* Might be reset by POPEVAL. */
+ STRLEN n_a;
PL_op = saveop;
if (PL_eval_root) {
@@ -2592,10 +2598,10 @@ doeval(int gimme, OP** startop)
lex_end();
LEAVE;
if (optype == OP_REQUIRE) {
- char* msg = SvPVx(ERRSV, PL_na);
+ char* msg = SvPVx(ERRSV, n_a);
DIE("%s", *msg ? msg : "Compilation failed in require");
} else if (startop) {
- char* msg = SvPVx(ERRSV, PL_na);
+ char* msg = SvPVx(ERRSV, n_a);
POPBLOCK(cx,PL_curpm);
POPEVAL(cx);
@@ -2668,13 +2674,14 @@ PP(pp_require)
SV** svp;
I32 gimme = G_SCALAR;
PerlIO *tryrsfp = 0;
+ STRLEN n_a;
sv = POPs;
if (SvNIOKp(sv) && !SvPOKp(sv)) {
SET_NUMERIC_STANDARD();
if (atof(PL_patchlevel) + 0.00000999 < SvNV(sv))
DIE("Perl %s required--this is only version %s, stopped",
- SvPV(sv,PL_na),PL_patchlevel);
+ SvPV(sv,n_a),PL_patchlevel);
RETPUSHYES;
}
name = SvPV(sv, len);
@@ -2717,7 +2724,7 @@ PP(pp_require)
{
namesv = NEWSV(806, 0);
for (i = 0; i <= AvFILL(ar); i++) {
- char *dir = SvPVx(*av_fetch(ar, i, TRUE), PL_na);
+ char *dir = SvPVx(*av_fetch(ar, i, TRUE), n_a);
#ifdef VMS
char *unixdir;
if ((unixdir = tounixpath(dir, Nullch)) == Nullch)
@@ -2753,7 +2760,7 @@ PP(pp_require)
sv_catpv(msg, " (did you run h2ph?)");
sv_catpv(msg, " (@INC contains:");
for (i = 0; i <= AvFILL(ar); i++) {
- char *dir = SvPVx(*av_fetch(ar, i, TRUE), PL_na);
+ char *dir = SvPVx(*av_fetch(ar, i, TRUE), n_a);
sv_setpvf(dirmsgsv, " %s", dir);
sv_catsv(msg, dirmsgsv);
}