diff options
author | Nicholas Clark <nick@ccl4.org> | 2021-10-18 19:56:09 +0000 |
---|---|---|
committer | Nicholas Clark <nicholas.clark@humanstate.com> | 2022-03-19 07:30:44 +0100 |
commit | 1db404fc7d10badcbca1c0f589d382fc79c57813 (patch) | |
tree | 2a4b32587951450b60627a6d6c503c90655bac70 /sv.c | |
parent | 5983026606b07a11e381fbd9fca44a9e1fa7d497 (diff) | |
download | perl-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 'sv.c')
-rw-r--r-- | sv.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4929,7 +4929,7 @@ Perl_sv_sethek(pTHX_ SV *const sv, const HEK *const hek) sv_usepvn_flags(sv, as_utf8, utf8_len, SV_HAS_TRAILING_NUL); SvUTF8_on(sv); return; - } else if (flags & HVhek_UNSHARED) { + } else if (flags & HVhek_NOTSHARED) { sv_setpvn(sv, HEK_KEY(hek), HEK_LEN(hek)); if (HEK_UTF8(hek)) SvUTF8_on(sv); @@ -9496,7 +9496,7 @@ Perl_newSVhek(pTHX_ const HEK *const hek) sv_usepvn_flags(sv, as_utf8, utf8_len, SV_HAS_TRAILING_NUL); SvUTF8_on (sv); return sv; - } else if (flags & HVhek_UNSHARED) { + } else if (flags & HVhek_NOTSHARED) { /* A hash that isn't using shared hash keys has to have the flag in every key so that we know not to try to call share_hek_hek on it. */ |