# define CopSTASH(c) (CopSTASHPV(c) \
? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
# define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME_get(hv) : Nullch)
-# define CopSTASH_eq(c,hv) ((hv) \
- && (CopSTASHPV(c) == HvNAME_get(hv) \
- || (CopSTASHPV(c) && HvNAME_get(hv)\
- && strEQ(CopSTASHPV(c), HvNAME_get(hv)))))
+# define CopSTASH_eq(c,hv) ((hv) && stashpv_hvname_match(c,hv))
# ifdef NETWARE
# define CopSTASH_free(c) SAVECOPSTASH_FREE(c)
-# else
-# define CopSTASH_free(c) PerlMemShared_free(CopSTASHPV(c))
-# endif
-
-# ifdef NETWARE
# define CopFILE_free(c) SAVECOPFILE_FREE(c)
# else
-# define CopFILE_free(c) (PerlMemShared_free(CopFILE(c)),(CopFILE(c) = Nullch))
+# define CopSTASH_free(c) PerlMemShared_free(CopSTASHPV(c))
+# define CopFILE_free(c) (PerlMemShared_free(CopFILE(c)),(CopFILE(c) = Nullch))
# endif
#else
# define CopFILEGV(c) ((c)->cop_filegv)
dpR |bool |is_gv_magical_sv|SV *name|U32 flags
Apd |char* |savesvpv |SV* sv
+ApR |bool |stashpv_hvname_match|NN const COP *cop|NN const HV *hv
END_EXTERN_C
/*
#define is_gv_magical_sv Perl_is_gv_magical_sv
#endif
#define savesvpv Perl_savesvpv
+#define stashpv_hvname_match Perl_stashpv_hvname_match
#define ck_anoncode Perl_ck_anoncode
#define ck_bitop Perl_ck_bitop
#define ck_concat Perl_ck_concat
#define is_gv_magical_sv(a,b) Perl_is_gv_magical_sv(aTHX_ a,b)
#endif
#define savesvpv(a) Perl_savesvpv(aTHX_ a)
+#define stashpv_hvname_match(a,b) Perl_stashpv_hvname_match(aTHX_ a,b)
#define ck_anoncode(a) Perl_ck_anoncode(aTHX_ a)
#define ck_bitop(a) Perl_ck_bitop(aTHX_ a)
#define ck_concat(a) Perl_ck_concat(aTHX_ a)
Perl_gv_fetchpvn_flags
Perl_gv_fetchsv
Perl_savesvpv
+Perl_stashpv_hvname_match
# ex: set ro:
PERL_CALLCONV char* Perl_savesvpv(pTHX_ SV* sv);
+PERL_CALLCONV bool Perl_stashpv_hvname_match(pTHX_ const COP *cop, const HV *hv)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
END_EXTERN_C
/*
return myseed;
}
+#ifdef USE_ITHREADS
+bool
+Perl_stashpv_hvname_match(pTHX_ const COP *c, const HV *hv)
+{
+ const char * const stashpv = CopSTASHPV(c);
+ const char * const name = HvNAME_get(hv);
+
+ if (stashpv == name)
+ return TRUE;
+ if (stashpv && name)
+ if (strEQ(stashpv, name))
+ return TRUE;
+ return FALSE;
+}
+#endif
+
+
#ifdef PERL_GLOBAL_STRUCT
struct perl_vars *