X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Fautovivification.git;a=blobdiff_plain;f=autovivification.xs;h=e36b8f50dfc6f1ed7bdfec6f3c6d3a0b1df5a339;hp=62162de1c331793406b464b65a8e342b160f2e62;hb=0b4ae66b743ee623cdfdb7cdbea5c84338f9e3d9;hpb=6bc99454a8284978b14854642fac0123c77bac45 diff --git a/autovivification.xs b/autovivification.xs index 62162de..e36b8f5 100644 --- a/autovivification.xs +++ b/autovivification.xs @@ -134,11 +134,11 @@ START_MY_CXT #if A_WORKAROUND_REQUIRE_PROPAGATION typedef struct { - ptable *tbl; + ptable *tbl; #if A_HAS_PERL(5, 13, 2) CLONE_PARAMS *params; #else - CLONE_PARAMS params; + CLONE_PARAMS params; #endif } a_ptable_clone_ud; @@ -234,19 +234,19 @@ get_enclosing_cv: STATIC SV *a_tag(pTHX_ UV bits) { #define a_tag(B) a_tag(aTHX_ (B)) a_hint_t *h; -#if A_THREADSAFE - dMY_CXT; -#endif h = PerlMemShared_malloc(sizeof *h); h->bits = bits; h->require_tag = a_require_tag(); #if A_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 /* A_THREADSAFE */ return newSViv(PTR2IV(h)); @@ -255,16 +255,16 @@ STATIC SV *a_tag(pTHX_ UV bits) { STATIC UV a_detag(pTHX_ const SV *hint) { #define a_detag(H) a_detag(aTHX_ (H)) a_hint_t *h; -#if A_THREADSAFE - dMY_CXT; -#endif if (!(hint && SvIOK(hint))) return 0; h = INT2PTR(a_hint_t *, SvIVX(hint)); #if A_THREADSAFE - h = ptable_fetch(MY_CXT.tbl, h); + { + dMY_CXT; + h = ptable_fetch(MY_CXT.tbl, h); + } #endif /* A_THREADSAFE */ if (a_require_tag() != h->require_tag) @@ -320,7 +320,7 @@ STATIC UV a_hint(pTHX) { 0, a_hash); #else - SV **val = hv_fetch(GvHV(PL_hintgv), __PACKAGE__, __PACKAGE_LEN__, a_hash); + SV **val = hv_fetch(GvHV(PL_hintgv), __PACKAGE__, __PACKAGE_LEN__, 0); if (!val) return 0; hint = *val; @@ -331,9 +331,9 @@ STATIC UV a_hint(pTHX) { /* ... op => info map ...................................................... */ typedef struct { - OP *(*old_pp)(pTHX); - UV flags; - void *next; + OP *(*old_pp)(pTHX); + void *next; + UV flags; } a_op_info; #define PTABLE_NAME ptable_map