summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-10-18 19:56:09 +0000
committerNicholas Clark <nicholas.clark@humanstate.com>2022-03-19 07:30:44 +0100
commit1db404fc7d10badcbca1c0f589d382fc79c57813 (patch)
tree2a4b32587951450b60627a6d6c503c90655bac70 /hv.h
parent5983026606b07a11e381fbd9fca44a9e1fa7d497 (diff)
downloadperl-1db404fc7d10badcbca1c0f589d382fc79c57813.tar.gz
Rename HVhek_UNSHARED to HVhek_NOTSHARED
"HVhek_UNSHARED" marked unshared HEKs - allocated directly with malloc(), rather then from the shared string table, and released with free(). But *shared* HEKs (in the shared string table) are released by calling unshare_hek(), whilst unshared HEKs should never go near this. So rename them to "not shared", to avoid this confusion. Change their flag bit from 0x08 to 0x04 to remove a gap. 0x04 had previously been used to flag "REHASH", which was removed before v5.18.0 Move the definition of the macro HVhek_MASK from hv.h to hv.c
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/hv.h b/hv.h
index 4e427b4a36..3bc608f2d9 100644
--- a/hv.h
+++ b/hv.h
@@ -407,7 +407,7 @@ See L</hv_fill>.
#define HVhek_UTF8 0x01 /* Key is utf8 encoded. */
#define HVhek_WASUTF8 0x02 /* Key is bytes here, but was supplied as utf8. */
-#define HVhek_UNSHARED 0x08 /* This key isn't a shared hash key. */
+#define HVhek_NOTSHARED 0x04 /* This key isn't a shared hash key. */
/* the following flags are options for functions, they are not stored in heks */
#define HVhek_FREEKEY 0x100 /* Internal flag to say key is Newx()ed. */
#define HVhek_PLACEHOLD 0x200 /* Internal flag to create placeholder.
@@ -415,9 +415,7 @@ See L</hv_fill>.
#define HVhek_KEYCANONICAL 0x400 /* Internal flag - key is in canonical form.
If the string is UTF-8, it cannot be
converted to bytes. */
-#define HVhek_MASK 0xFF
-
-#define HVhek_ENABLEHVKFLAGS (HVhek_MASK & ~(HVhek_UNSHARED))
+#define HVhek_ENABLEHVKFLAGS (HVhek_UTF8|HVhek_WASUTF8)
#define HEK_UTF8(hek) (HEK_FLAGS(hek) & HVhek_UTF8)
#define HEK_UTF8_on(hek) (HEK_FLAGS(hek) |= HVhek_UTF8)