summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-11-03 06:16:40 -0800
committerFather Chrysostomos <sprout@cpan.org>2013-11-04 05:10:19 -0800
commit3386c920d024b7aaa613cda823bad312086c33ff (patch)
tree921bda28705e5266f2337ae0c6c1f4612a40f910 /hv.h
parent3d8812a2a5ed72332e86e2f36bc5caa37e3e75c0 (diff)
downloadperl-3386c920d024b7aaa613cda823bad312086c33ff.tar.gz
Make mro code pass precomputed hash values
where possible This involved adding hv_fetchhek and hv_storehek macros and changing S_mro_clean_isarev to accept a hash parameter and expect HVhek_UTF8 instead of SVf_UTF8.
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/hv.h b/hv.h
index 6062522d46..b8f496c60d 100644
--- a/hv.h
+++ b/hv.h
@@ -471,6 +471,16 @@ C<SV*>.
(flags) | HV_DELETE, NULL, 0)))
#ifdef PERL_CORE
+# define hv_storehek(hv, hek, val) \
+ hv_common((hv), NULL, HEK_KEY(hek), HEK_LEN(hek), HEK_UTF8(hek), \
+ HV_FETCH_ISSTORE|HV_FETCH_JUST_SV, (val), HEK_HASH(hek))
+# define hv_fetchhek(hv, hek, lval) \
+ ((SV **) \
+ hv_common((hv), NULL, HEK_KEY(hek), HEK_LEN(hek), HEK_UTF8(hek), \
+ (lval) \
+ ? (HV_FETCH_JUST_SV | HV_FETCH_LVALUE) \
+ : HV_FETCH_JUST_SV, \
+ NULL, HEK_HASH(hek)))
# define hv_deletehek(hv, hek, flags) \
hv_common((hv), NULL, HEK_KEY(hek), HEK_LEN(hek), HEK_UTF8(hek), \
(flags)|HV_DELETE, NULL, HEK_HASH(hek))