summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2001-07-11 16:23:37 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2001-07-11 13:13:27 +0000
commit1fcf4c126eb604a2803256137e52891a03090e84 (patch)
tree0e52b9ba379dfaf92f8f13447fb6e207ec6dbe2d /op.h
parent742dc7f97e9775960295fb61b8ceb6a959d8c031 (diff)
downloadperl-1fcf4c126eb604a2803256137e52891a03090e84.tar.gz
Threadsafe PMOPs! We might still win this war.
Message-ID: <000b01c10a04$4fa16a10$21000a0a@vogw2kdev> Threadsafe PMOPs for ithreads, waiting for AMS's Perl_re_dup(). p4raw-id: //depot/perl@11274
Diffstat (limited to 'op.h')
-rw-r--r--op.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/op.h b/op.h
index 05e45800af..352d358f5d 100644
--- a/op.h
+++ b/op.h
@@ -235,7 +235,11 @@ struct pmop {
OP * op_pmreplroot;
OP * op_pmreplstart;
PMOP * op_pmnext; /* list of all scanpats */
- REGEXP * op_pmregexp; /* compiled expression */
+#ifdef USE_ITHREADS
+ I32 op_pmoffset;
+#else
+ REGEXP * op_pmregexp; /* compiled expression */
+#endif
U16 op_pmflags;
U16 op_pmpermflags;
U8 op_pmdynflags;
@@ -246,8 +250,13 @@ struct pmop {
#endif
};
+#ifdef USE_ITHREADS
+#define PM_GETRE(o) ((REGEXP*)SvIV(PL_regex_pad[(o)->op_pmoffset]))
+#define PM_SETRE(o,r) (sv_setiv(PL_regex_pad[(o)->op_pmoffset], (IV)r))
+#else
#define PM_GETRE(o) ((o)->op_pmregexp)
#define PM_SETRE(o,r) ((o)->op_pmregexp = (r))
+#endif
#define PMdf_USED 0x01 /* pm has been used once already */
#define PMdf_TAINTED 0x02 /* pm compiled from tainted pattern */