diff options
author | Artur Bergman <sky@nanisky.com> | 2001-07-11 16:23:37 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-07-11 13:13:27 +0000 |
commit | 1fcf4c126eb604a2803256137e52891a03090e84 (patch) | |
tree | 0e52b9ba379dfaf92f8f13447fb6e207ec6dbe2d /op.h | |
parent | 742dc7f97e9775960295fb61b8ceb6a959d8c031 (diff) | |
download | perl-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.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 */ |