diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-05-02 22:19:56 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-05-02 22:19:56 +0000 |
commit | 45e3480058a48be9675e10a3f8cf34c1b211df0e (patch) | |
tree | c1e5b896209572ee5bfcd29b4edf3d9fc3ba2cb4 /hv.h | |
parent | 2b0ba25f0d6d021046bdee174d0cd9d6e42ab48a (diff) | |
download | perl-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.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |