diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2007-01-12 10:42:05 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2007-01-12 10:42:05 +0000 |
commit | 043e41b864c9e8505919cb1347c4b340f7fd081b (patch) | |
tree | 4d5dc2a5b737dbdaf1f8c64333619bdbd8ee056a /doop.c | |
parent | c3e59998489df5fb30c82b6a5cc3359f27348c64 (diff) | |
download | perl-043e41b864c9e8505919cb1347c4b340f7fd081b.tar.gz |
make tr/// threadsafe by moving swash into pad
p4raw-id: //depot/perl@29765
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -307,7 +307,12 @@ S_do_trans_simple_utf8(pTHX_ SV * const sv) const I32 grows = PL_op->op_private & OPpTRANS_GROWS; STRLEN len; - SV* const rv = (SV*)cSVOP->op_sv; + SV* const rv = +#ifdef USE_ITHREADS + PAD_SVl(cPADOP->op_padix); +#else + (SV*)cSVOP->op_sv; +#endif HV* const hv = (HV*)SvRV(rv); SV* const * svp = hv_fetchs(hv, "NONE", FALSE); const UV none = svp ? SvUV(*svp) : 0x7fffffff; @@ -403,7 +408,12 @@ S_do_trans_count_utf8(pTHX_ SV * const sv) I32 matches = 0; STRLEN len; - SV* const rv = (SV*)cSVOP->op_sv; + SV* const rv = +#ifdef USE_ITHREADS + PAD_SVl(cPADOP->op_padix); +#else + (SV*)cSVOP->op_sv; +#endif HV* const hv = (HV*)SvRV(rv); SV* const * const svp = hv_fetchs(hv, "NONE", FALSE); const UV none = svp ? SvUV(*svp) : 0x7fffffff; @@ -447,7 +457,12 @@ S_do_trans_complex_utf8(pTHX_ SV * const sv) const I32 squash = PL_op->op_private & OPpTRANS_SQUASH; const I32 del = PL_op->op_private & OPpTRANS_DELETE; const I32 grows = PL_op->op_private & OPpTRANS_GROWS; - SV * const rv = (SV*)cSVOP->op_sv; + SV* const rv = +#ifdef USE_ITHREADS + PAD_SVl(cPADOP->op_padix); +#else + (SV*)cSVOP->op_sv; +#endif HV * const hv = (HV*)SvRV(rv); SV * const *svp = hv_fetchs(hv, "NONE", FALSE); const UV none = svp ? SvUV(*svp) : 0x7fffffff; |