X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Fre-engine-Plugin.git;a=blobdiff_plain;f=Plugin.xs;h=cffc46389e01ad1d6175296136266d36eefd88b1;hp=f420478a2a6f586dfa364bcaf5cbba1e4961d08b;hb=92cf1014a173792464bbe74d342d9c44bb7698ee;hpb=cc6237beff79aa6af04e8c966acbea6b3908e743 diff --git a/Plugin.xs b/Plugin.xs index f420478..cffc463 100644 --- a/Plugin.xs +++ b/Plugin.xs @@ -13,6 +13,20 @@ #define REP_HAS_PERL(R, V, S) (PERL_REVISION > (R) || (PERL_REVISION == (R) && (PERL_VERSION > (V) || (PERL_VERSION == (V) && (PERL_SUBVERSION >= (S)))))) +#undef ENTERn +#if defined(ENTER_with_name) && !REP_HAS_PERL(5, 11, 4) +# define ENTERn(N) ENTER_with_name(N) +#else +# define ENTERn(N) ENTER +#endif + +#undef LEAVEn +#if defined(LEAVE_with_name) && !REP_HAS_PERL(5, 11, 4) +# define LEAVEn(N) LEAVE_with_name(N) +#else +# define LEAVEn(N) LEAVE +#endif + #ifndef REP_WORKAROUND_REQUIRE_PROPAGATION # define REP_WORKAROUND_REQUIRE_PROPAGATION !REP_HAS_PERL(5, 10, 1) #endif @@ -235,12 +249,17 @@ STATIC const rep_hint_t *rep_hint(pTHX) { #define rep_hint() rep_hint(aTHX) SV *hint; +#ifdef cop_hints_fetch_pvn + hint = cop_hints_fetch_pvn(PL_curcop, + __PACKAGE__, __PACKAGE_LEN__, rep_hash, 0); +#else /* We already require 5.9.5 for the regexp engine API. */ hint = Perl_refcounted_he_fetch(aTHX_ PL_curcop->cop_hints_hash, NULL, __PACKAGE__, __PACKAGE_LEN__, 0, rep_hash); +#endif return rep_detag(hint); } @@ -657,6 +676,13 @@ CODE: MY_CXT.tbl = t; MY_CXT.owner = aTHX; } + { + level = PerlMemShared_malloc(sizeof *level); + *level = 1; + LEAVEn("sub"); + SAVEDESTRUCTOR_X(rep_thread_cleanup, level); + ENTERn("sub"); + } #endif