summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2003-10-25 13:10:21 +0000
committerNicholas Clark <nick@ccl4.org>2003-10-25 13:10:21 +0000
commitbc92a800b506a714f5af60e9261c914eb78da89b (patch)
treecac199b272606e33c6d68712ac3cbccaecb40ffc /hv.h
parent6c0731c3784186294017516545e3530192f2be03 (diff)
downloadperl-bc92a800b506a714f5af60e9261c914eb78da89b.tar.gz
Plan C rough edge smoothing. Criteria for a hash split is now
the earlier of "more keys than buckets" (the old test) or linked list too long. Rehash is triggered after a split if the longest linked list is too long. p4raw-id: //depot/perl@21533
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/hv.h b/hv.h
index 1c7fcda241..5f8344004d 100644
--- a/hv.h
+++ b/hv.h
@@ -212,6 +212,7 @@ C<SV*>.
* is utf8 (including 8 bit keys that were entered as utf8, and need upgrading
* when retrieved during iteration. It may still be set when there are no longer
* any utf8 keys.
+ * See HVhek_ENABLEHVKFLAGS for the trigger.
*/
#define HvHASKFLAGS(hv) (SvFLAGS(hv) & SVphv_HASKFLAGS)
#define HvHASKFLAGS_on(hv) (SvFLAGS(hv) |= SVphv_HASKFLAGS)
@@ -283,6 +284,16 @@ C<SV*>.
* (may change, but Storable is a core module) */
#define HVhek_MASK 0xFF
+/* Which flags enable HvHASKFLAGS? Somewhat a hack on a hack, as
+ HVhek_REHASH is only needed because the rehash flag has to be duplicated
+ into all keys as hv_iternext has no access to the hash flags. At this
+ point Storable's tests get upset, because sometimes hashes are "keyed"
+ and sometimes not, depending on the order of data insertion, and whether
+ it triggered rehashing. So currently HVhek_REHAS is exempt.
+*/
+
+#define HVhek_ENABLEHVKFLAGS (HVhek_MASK - HVhek_REHASH)
+
#define HEK_UTF8(hek) (HEK_FLAGS(hek) & HVhek_UTF8)
#define HEK_UTF8_on(hek) (HEK_FLAGS(hek) |= HVhek_UTF8)
#define HEK_UTF8_off(hek) (HEK_FLAGS(hek) &= ~HVhek_UTF8)