summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-05-02 22:19:56 +0000
committerNicholas Clark <nick@ccl4.org>2006-05-02 22:19:56 +0000
commit45e3480058a48be9675e10a3f8cf34c1b211df0e (patch)
treec1e5b896209572ee5bfcd29b4edf3d9fc3ba2cb4 /hv.h
parent2b0ba25f0d6d021046bdee174d0cd9d6e42ab48a (diff)
downloadperl-45e3480058a48be9675e10a3f8cf34c1b211df0e.tar.gz
Add a new hash key flag HVhek_UNSHARED, to mark all unshared hash keys.
Otherwise Perl_newSVhek(), called by Perl_hv_iterkeysv(), naively assumes that it can share any hash key directly. p4raw-id: //depot/perl@28069
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/hv.h b/hv.h
index 9e31335228..bd157f8b11 100644
--- a/hv.h
+++ b/hv.h
@@ -323,6 +323,7 @@ C<SV*>.
#define HVhek_UTF8 0x01 /* Key is utf8 encoded. */
#define HVhek_WASUTF8 0x02 /* Key is bytes here, but was supplied as utf8. */
#define HVhek_REHASH 0x04 /* This key is in an hv using a custom HASH . */
+#define HVhek_UNSHARED 0x08 /* This key isn't a shared hash key. */
#define HVhek_FREEKEY 0x100 /* Internal flag to say key is malloc()ed. */
#define HVhek_PLACEHOLD 0x200 /* Internal flag to create placeholder.
* (may change, but Storable is a core module) */
@@ -333,10 +334,11 @@ C<SV*>.
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.
+ it triggered rehashing. So currently HVhek_REHASH is exempt.
+ Similarly UNSHARED
*/
-#define HVhek_ENABLEHVKFLAGS (HVhek_MASK - HVhek_REHASH)
+#define HVhek_ENABLEHVKFLAGS (HVhek_MASK & ~(HVhek_REHASH|HVhek_UNSHARED))
#define HEK_UTF8(hek) (HEK_FLAGS(hek) & HVhek_UTF8)
#define HEK_UTF8_on(hek) (HEK_FLAGS(hek) |= HVhek_UTF8)