Front page | perl.perl5.porters |
Postings from July 2001
Re: POINTERRIGOR
Thread Previous
|
Thread Next
From:
Andy Dougherty
Date:
July 3, 2001 08:48
Subject:
Re: POINTERRIGOR
Message ID:
Pine.SOL.4.10.10107031040030.1982-100000@maxwell.phys.lafayette.edu
On Mon, 18 Jun 2001, Abhijit Menon-Sen wrote:
> util.c does:
>
> #ifdef POINTERRIGOR
[ . . . ]
> What's this for? (POINTERRIGOR is not defined anywhere, and the p5p
> archive doesn't know.) Do some compilers which have problems comparing
> things like "s += tmp"? Which ones?
Short answer: It's very old and can probably be safely removed.
Longer answer:
It was added in perl3.027, but I didn't see any obvious
description for it. It may well have been addressing a concern
that a statement like C<big -= previous;> could end up with C<big>
crossing a segment boundary in a segmented architecture.
However, nothing's been setting POINTERRIGOR in perl5 for years, so I
think it can be safely dropped. That way it won't get picked up and
carried over to perl6 :-).
Here's a patch to do so.
diff -r -u perl-current/util.c perl-andy/util.c
--- perl-current/util.c Mon Jul 2 05:06:08 2001
+++ perl-andy/util.c Tue Jul 3 10:58:45 2001
@@ -692,16 +692,8 @@
top2:
/*SUPPRESS 560*/
if ((tmp = table[*s])) {
-#ifdef POINTERRIGOR
- if (bigend - s > tmp) {
- s += tmp;
- goto top2;
- }
- s += tmp;
-#else
if ((s += tmp) < bigend)
goto top2;
-#endif
goto check_end;
}
else { /* less expensive than calling strncmp() */
@@ -795,25 +787,6 @@
if (!(pos += PL_screamnext[pos]))
goto cant_find;
}
-#ifdef POINTERRIGOR
- do {
- if (pos >= stop_pos) break;
- if (big[pos-previous] != first)
- continue;
- for (x=big+pos+1-previous,s=little; s < littleend; /**/ ) {
- if (*s++ != *x++) {
- s--;
- break;
- }
- }
- if (s == littleend) {
- *old_posp = pos;
- if (!last) return (char *)(big+pos-previous);
- found = 1;
- }
- } while ( pos += PL_screamnext[pos] );
- return (last && found) ? (char *)(big+(*old_posp)-previous) : Nullch;
-#else /* !POINTERRIGOR */
big -= previous;
do {
if (pos >= stop_pos) break;
@@ -833,7 +806,6 @@
} while ( pos += PL_screamnext[pos] );
if (last && found)
return (char *)(big+(*old_posp));
-#endif /* POINTERRIGOR */
check_tail:
if (!SvTAIL(littlestr) || (end_shift > 0))
return Nullch;
--
Andy Dougherty doughera@lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
Thread Previous
|
Thread Next
-
POINTERRIGOR
by Abhijit Menon-Sen
-
Re: POINTERRIGOR
by Andy Dougherty