X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Types.xs;h=73cacfca18f300e244651da527bd134abe06a57f;hb=0dcfddc6bb7dd1913079233b16233f4b359162b4;hp=bb6c6a629eb071e7984acd3d860b70fb6e701cbd;hpb=d466b48db5ca65f6f5ce4f86788822bf81047f31;p=perl%2Fmodules%2FLexical-Types.git diff --git a/Types.xs b/Types.xs index bb6c6a6..73cacfc 100644 --- a/Types.xs +++ b/Types.xs @@ -284,9 +284,6 @@ STATIC SV *lt_tag(pTHX_ SV *value) { #define lt_tag(V) lt_tag(aTHX_ (V)) lt_hint_t *h; SV *code = NULL; -#if LT_THREADSAFE - dMY_CXT; -#endif if (SvROK(value)) { value = SvRV(value); @@ -307,10 +304,13 @@ STATIC SV *lt_tag(pTHX_ SV *value) { #endif /* !LT_HINT_STRUCT */ #if LT_THREADSAFE - /* We only need for the key to be an unique tag for looking up the value later. - * Allocated memory provides convenient unique identifiers, so that's why we - * use the hint as the key itself. */ - ptable_hints_store(MY_CXT.tbl, h, h); + { + dMY_CXT; + /* We only need for the key to be an unique tag for looking up the value later + * Allocated memory provides convenient unique identifiers, so that's why we + * use the hint as the key itself. */ + ptable_hints_store(MY_CXT.tbl, h, h); + } #endif /* LT_THREADSAFE */ return newSViv(PTR2IV(h)); @@ -544,10 +544,10 @@ STATIC OP *lt_pp_padsv(pTHX) { LEAVE; } - return CALL_FPTR(oi.old_pp_padsv)(aTHX); + return oi.old_pp_padsv(aTHX); } - return CALL_FPTR(PL_op->op_ppaddr)(aTHX); + return PL_op->op_ppaddr(aTHX); } /* ... Our ck_pad{any,sv} .................................................. */ @@ -562,12 +562,12 @@ STATIC OP *(*lt_old_ck_padany)(pTHX_ OP *) = 0; STATIC OP *lt_ck_padany(pTHX_ OP *o) { HV *stash; SV *code; - dMY_CXT; - o = CALL_FPTR(lt_old_ck_padany)(aTHX_ o); + o = lt_old_ck_padany(aTHX_ o); stash = PL_in_my_stash; if (stash && (code = lt_hint())) { + dMY_CXT; SV *orig_pkg = newSVpvn(HvNAME_get(stash), HvNAMELEN_get(stash)); SV *orig_meth = MY_CXT.default_meth; SV *type_pkg = NULL; @@ -639,11 +639,9 @@ skip: STATIC OP *(*lt_old_ck_padsv)(pTHX_ OP *) = 0; STATIC OP *lt_ck_padsv(pTHX_ OP *o) { - dMY_CXT; - lt_map_delete(o); - return CALL_FPTR(lt_old_ck_padsv)(aTHX_ o); + return lt_old_ck_padsv(aTHX_ o); } /* ... Our peephole optimizer .............................................. */ @@ -749,8 +747,6 @@ STATIC void lt_peep(pTHX_ OP *o) { STATIC U32 lt_initialized = 0; STATIC void lt_teardown(pTHX_ void *root) { - dMY_CXT; - if (!lt_initialized) return; @@ -759,13 +755,16 @@ STATIC void lt_teardown(pTHX_ void *root) { return; #endif + { + dMY_CXT; #if LT_THREADSAFE - ptable_hints_free(MY_CXT.tbl); + ptable_hints_free(MY_CXT.tbl); #endif #if !LT_HAS_RPEEP - ptable_seen_free(MY_CXT.seen); + ptable_seen_free(MY_CXT.seen); #endif - SvREFCNT_dec(MY_CXT.default_meth); + SvREFCNT_dec(MY_CXT.default_meth); + } PL_check[OP_PADANY] = MEMBER_TO_FPTR(lt_old_ck_padany); lt_old_ck_padany = 0;