summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-11-03 11:12:57 +1100
committerTony Cook <tony@develop-help.com>2016-11-03 11:12:57 +1100
commitea3ffa52d4da2260b940cb269b4e4f51ecd6bc7b (patch)
treeb711998e2cd1f7ddc340fb625fe9727c1de7a4f4 /hv.h
parentb0b342d4b3fa61880a96b645a3dab648f7c4c682 (diff)
downloadperl-ea3ffa52d4da2260b940cb269b4e4f51ecd6bc7b.tar.gz
Revert "hv.h: rework HEK_FLAGS to a proper member in struct hek"
This reverts commit d3148f758506efd28325dfd8e1b698385133f0cd. SV keys are stored as pointers in the key_key, on platforms with alignment requirements (such as PA-RISC) this resulted in bus errors early in the build.
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/hv.h b/hv.h
index 16634b7e44..ee536f08c8 100644
--- a/hv.h
+++ b/hv.h
@@ -45,9 +45,10 @@ struct he {
struct hek {
U32 hek_hash; /* hash of key */
I32 hek_len; /* length of hash key */
- char hek_flags; /* The flags associated with this 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 */
};
struct shared_he {
@@ -396,7 +397,7 @@ C<SV*>.
#define HEK_HASH(hek) (hek)->hek_hash
#define HEK_LEN(hek) (hek)->hek_len
#define HEK_KEY(hek) (hek)->hek_key
-#define HEK_FLAGS(hek) (hek)->hek_flags
+#define HEK_FLAGS(hek) (*((unsigned char *)(HEK_KEY(hek))+HEK_LEN(hek)+1))
#define HVhek_UTF8 0x01 /* Key is utf8 encoded. */
#define HVhek_WASUTF8 0x02 /* Key is bytes here, but was supplied as utf8. */