#define PL_scopestack_max (vTHX->Iscopestack_max)
#define PL_scopestack_name (vTHX->Iscopestack_name)
#define PL_screamfirst (vTHX->Iscreamfirst)
-#define PL_screamnext (vTHX->Iscreamnext)
#define PL_secondgv (vTHX->Isecondgv)
#define PL_sharehook (vTHX->Isharehook)
#define PL_sig_pending (vTHX->Isig_pending)
#define PL_Iscopestack_max PL_scopestack_max
#define PL_Iscopestack_name PL_scopestack_name
#define PL_Iscreamfirst PL_screamfirst
-#define PL_Iscreamnext PL_screamnext
#define PL_Isecondgv PL_secondgv
#define PL_Isharehook PL_sharehook
#define PL_Isig_pending PL_sig_pending
/* regex stuff */
PERLVAR(Iscreamfirst, I32 *)
-PERLVAR(Iscreamnext, I32 *)
PERLVAR(Ilastscream, SV *)
PERLVAR(Ireg_state, struct re_save_state)
PL_lastscream = NULL;
Safefree(PL_screamfirst);
PL_screamfirst = 0;
- Safefree(PL_screamnext);
- PL_screamnext = 0;
/* float buffer */
Safefree(PL_efloatbuf);
if (pos > PL_maxscream) {
if (PL_maxscream < 0) {
PL_maxscream = pos + 80;
- Newx(PL_screamfirst, 256, I32);
- Newx(PL_screamnext, PL_maxscream, I32);
+ Newx(PL_screamfirst, 256 + PL_maxscream, I32);
}
else {
PL_maxscream = pos + pos / 4;
- Renew(PL_screamnext, PL_maxscream, I32);
+ Renew(PL_screamfirst, 256 + PL_maxscream, I32);
}
}
- sfirst = PL_screamfirst;
- snext = PL_screamnext;
+ snext = sfirst = PL_screamfirst;
- if (!sfirst || !snext)
+ if (!sfirst)
DIE(aTHX_ "do_study: out of memory");
for (ch = 256; ch; --ch)
- *sfirst++ = -1;
- sfirst -= 256;
+ *snext++ = -1;
while (--pos >= 0) {
register const I32 ch = s[pos];
/* regex stuff */
PL_screamfirst = NULL;
- PL_screamnext = NULL;
PL_maxscream = -1; /* reinits on demand */
PL_lastscream = NULL;
register I32 stop_pos;
register const unsigned char *littleend;
I32 found = 0;
+ const I32 *screamnext = PL_screamfirst + 256;
PERL_ARGS_ASSERT_SCREAMINSTR;
assert(SvVALID(littlestr));
pos = *old_posp == -1
- ? PL_screamfirst[BmRARE(littlestr)] : PL_screamnext[*old_posp];
+ ? PL_screamfirst[BmRARE(littlestr)] : screamnext[*old_posp];
if (pos == -1) {
cant_find:
if ( BmRARE(littlestr) == '\n'
return NULL;
}
while (pos < previous + start_shift) {
- pos = PL_screamnext[pos];
+ pos = screamnext[pos];
if (pos == -1)
goto cant_find;
}
found = 1;
}
}
- pos = PL_screamnext[pos];
+ pos = screamnext[pos];
} while (pos != -1);
if (last && found)
return (char *)(big+(*old_posp));