diff options
author | Nicholas Clark <nick@ccl4.org> | 2021-08-20 15:20:13 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2021-10-11 11:30:25 +0000 |
commit | 94ee6ed79dbca73d0345b745534477e4017fb990 (patch) | |
tree | 2743d0b040c1dce45f0a921cccbaf3c324b71509 /sv.h | |
parent | 36149847e29e423be58d70fad50d9908be1d0373 (diff) | |
download | perl-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.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |