#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);
#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));
STATIC OP *lt_ck_padany(pTHX_ OP *o) {
HV *stash;
SV *code;
- dMY_CXT;
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;
STATIC OP *(*lt_old_ck_padsv)(pTHX_ OP *) = 0;
STATIC OP *lt_ck_padsv(pTHX_ OP *o) {
- dMY_CXT;
-
lt_map_delete(o);
return lt_old_ck_padsv(aTHX_ o);
STATIC U32 lt_initialized = 0;
STATIC void lt_teardown(pTHX_ void *root) {
- dMY_CXT;
-
if (!lt_initialized)
return;
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;