summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2013-03-27 13:20:08 +0100
committerYves Orton <demerphq@gmail.com>2013-03-27 13:27:22 +0100
commitf6bb1c88770cae114ab47307e530a957e9e385a7 (patch)
tree254fc59f2d5b5d8456160ba855f70693fb5bc4a0 /hv.h
parentec16d31fbe48930f52f1cc24a9bf1ff6686cf977 (diff)
downloadperl-f6bb1c88770cae114ab47307e530a957e9e385a7.tar.gz
eliminate the only internal uses of HvFILL
The usages are as far as I know incorrect anyway. We resize the hash bucket array based on the number of keys it holds, not based on the number of buckets that are used, so this usage was wrong anyway. Another bug that this revealed is that the old code would allow HvMAX(hv) to fall to 0, even though every other part of the core expects it to have a minimum of 7 (meaning 8 buckets). As part of this we change the hard coded 7 to a defined constant PERL_HASH_DEFAULT_HvMAX. After this patch there remains one use of HvFILL in core, that used for scalar(%hash) which I plan to remove in a later patch.
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hv.h b/hv.h
index 61bc5bd54b..270ae00157 100644
--- a/hv.h
+++ b/hv.h
@@ -208,6 +208,8 @@ C<SV*>.
=cut
*/
+#define PERL_HASH_DEFAULT_HvMAX 7
+
/* these hash entry flags ride on hent_klen (for use only in magic/tied HVs) */
#define HEf_SVKEY -2 /* hent_key is an SV* */