S_del_body is sufficiently small that inlining it is a space win.
[p5sagit/p5-mst-13.2.git] / hv.h
diff --git a/hv.h b/hv.h
index ac4bdd3..fc5bcde 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -14,6 +14,9 @@ typedef struct hek HEK;
 
 /* entry in hash value chain */
 struct he {
+    /* Keep hent_next first in this structure, because sv_free_arenas take
+       advantage of this to share code between the he arenas and the SV
+       body arenas  */
     HE         *hent_next;     /* next entry in chain */
     HEK                *hent_hek;      /* hash key */
     SV         *hent_val;      /* scalar value that was hashed */
@@ -364,6 +367,13 @@ C<SV*>.
 #define Perl_sharepvn(sv, len, hash) HEK_KEY(share_hek(sv, len, hash))
 #define sharepvn(sv, len, hash)             Perl_sharepvn(sv, len, hash)
 
+#define share_hek_hek(hek)                                             \
+    (++(((struct shared_he *)(((char *)hek)                            \
+                             - STRUCT_OFFSET(struct shared_he,         \
+                                             shared_he_hek)))          \
+       ->shared_he_he.hent_val),                                       \
+     hek)
+
 /*
  * Local variables:
  * c-indentation-style: bsd