diff options
author | Yves Orton <demerphq@gmail.com> | 2016-11-03 10:03:26 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2016-11-03 10:03:26 +0100 |
commit | 551f9d97a74adb55882f5ce5672c5682fd80c0f6 (patch) | |
tree | beccf4a1ff550070bd516f036c03f46bffbed965 /hv.h | |
parent | ea3ffa52d4da2260b940cb269b4e4f51ecd6bc7b (diff) | |
download | perl-551f9d97a74adb55882f5ce5672c5682fd80c0f6.tar.gz |
add a comment about the properties of struct hek
Diffstat (limited to 'hv.h')
-rw-r--r-- | hv.h | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -43,12 +43,18 @@ struct he { /* hash key -- defined separately for use as shared pointer */ struct hek { - U32 hek_hash; /* hash of key */ - I32 hek_len; /* length of hash key */ - char hek_key[1]; /* variable-length hash key */ + U32 hek_hash; /* computed hash of key */ + I32 hek_len; /* length of the hash key */ + /* Be careful! Sometimes we store a pointer in the hek_key + * buffer, which means it must be 8 byte aligned or things + * dont work on aligned platforms like HPUX + * Also beware, the last byte of the hek_key buffer is a + * hidden flags byte about the key. */ + */ + char hek_key[1]; /* variable-length hash key */ /* the hash-key is \0-terminated */ /* after the \0 there is a byte for flags, such as whether the key - is UTF-8 */ + is UTF-8 or WAS-UTF-8, or an SV */ }; struct shared_he { |