summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-08-20 15:20:13 +0000
committerNicholas Clark <nick@ccl4.org>2021-10-11 11:30:25 +0000
commit94ee6ed79dbca73d0345b745534477e4017fb990 (patch)
tree2743d0b040c1dce45f0a921cccbaf3c324b71509 /sv.h
parent36149847e29e423be58d70fad50d9908be1d0373 (diff)
downloadperl-94ee6ed79dbca73d0345b745534477e4017fb990.tar.gz
Split the XPVHV body into two variants "normal" and "with aux"
Default to the smaller body, and switch to the larger body if we need to allocate a C<struct xpvhv_aux> (eg need an iterator). This restores the previous small size optimisation for hashes used as objects.
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sv.h b/sv.h
index 83fa92380b..c4ee152989 100644
--- a/sv.h
+++ b/sv.h
@@ -174,10 +174,14 @@ typedef enum {
#endif
/* The array of arena roots for SV bodies is indexed by SvTYPE. SVt_NULL doesn't
- * use a body, so that arena root is re-used for HEs. */
+ * use a body, so that arena root is re-used for HEs. SVt_IV also doesn't, so
+ * that arena root is used for HVs with struct xpvhv_aux. */
#if defined(PERL_IN_HV_C) || defined(PERL_IN_XS_APITEST)
# define HE_ARENA_ROOT_IX SVt_NULL
#endif
+#if defined(PERL_IN_HV_C) || defined(PERL_IN_SV_C)
+# define HVAUX_ARENA_ROOT_IX SVt_IV
+#endif
#ifdef PERL_IN_SV_C
# define SVt_FIRST SVt_NULL /* the type of SV that new_SV() in sv.c returns */
#endif