flags |= HVhek_REHASH;
} else if (!hash) {
if (keysv && (SvIsCOW_shared_hash(keysv))) {
- hash = SvUVX(keysv);
+ hash = SvSHARED_HASH(keysv);
} else {
PERL_HASH(hash, key, klen);
}
PERL_HASH_INTERNAL(hash, key, klen);
} else if (!hash) {
if (keysv && (SvIsCOW_shared_hash(keysv))) {
- hash = SvUVX(keysv);
+ hash = SvSHARED_HASH(keysv);
} else {
PERL_HASH(hash, key, klen);
}
const U32 lval = PL_op->op_flags & OPf_MOD || LVRET;
const U32 defer = PL_op->op_private & OPpLVAL_DEFER;
SV *sv;
- const U32 hash = (SvIsCOW_shared_hash(keysv)) ? SvUVX(keysv) : 0;
+ const U32 hash = (SvIsCOW_shared_hash(keysv)) ? SvSHARED_HASH(keysv) : 0;
I32 preeminent = 0;
if (SvTYPE(hv) == SVt_PVHV) {
{
dSP;
SV* sv = cSVOP_sv;
- U32 hash = SvUVX(sv);
+ U32 hash = SvSHARED_HASH(sv);
XPUSHs(method_common(sv, &hash));
RETURN;
#endif
{
/* SvIsCOW_shared_hash */
- UV hash = SvUVX(sstr);
+ UV hash = SvSHARED_HASH(sstr);
DEBUG_C(PerlIO_printf(Perl_debug_log,
"Copy on write: Sharing hash\n"));
SvPV_set(dstr,
if (SvLEN(sstr) == 0) {
/* source is a COW shared hash key. */
- UV hash = SvUVX(sstr);
+ UV hash = SvSHARED_HASH(sstr);
DEBUG_C(PerlIO_printf(Perl_debug_log,
"Fast copy on write: Sharing hash\n"));
SvUV_set(dstr, hash);
const char *pvx = SvPVX_const(sv);
STRLEN len = SvLEN(sv);
STRLEN cur = SvCUR(sv);
- U32 hash = SvUVX(sv);
+ U32 hash = SvSHARED_HASH(sv);
SV *next = SV_COW_NEXT_SV(sv); /* next COW sv in the loop. */
if (DEBUG_C_TEST) {
PerlIO_printf(Perl_debug_log,
const char *pvx = SvPVX_const(sv);
const int is_utf8 = SvUTF8(sv);
STRLEN len = SvCUR(sv);
- U32 hash = SvUVX(sv);
+ U32 hash = SvSHARED_HASH(sv);
SvFAKE_off(sv);
SvREADONLY_off(sv);
SvPV_set(sv, (char*)0);
(SVf_FAKE | SVf_READONLY))
#define SvIsCOW_shared_hash(sv) (SvIsCOW(sv) && SvLEN(sv) == 0)
+#define SvSHARED_HASH(sv) SvUVX(sv)
+
/* flag values for sv_*_flags functions */
#define SV_IMMEDIATE_UNREF 1
#define SV_GMAGIC 2