@@ -2055,31 +2055,33 @@ Returns the hash for C<sv> created by C<L</newSVpvn_share>>.
2055
2055
=cut
2056
2056
*/
2057
2057
2058
- #define SV_IMMEDIATE_UNREF 1
2059
- #define SV_GMAGIC 2
2060
- #define SV_COW_DROP_PV 4
2061
- #define SV_NOSTEAL 16
2062
- #define SV_CONST_RETURN 32
2063
- #define SV_MUTABLE_RETURN 64
2064
- #define SV_SMAGIC 128
2065
- #define SV_HAS_TRAILING_NUL 256
2066
- #define SV_COW_SHARED_HASH_KEYS 512
2058
+ /* Flags used as `U32 flags` arguments to various functions */
2059
+ #define SV_IMMEDIATE_UNREF (1 << 0) /* 0x0001 - 1 */
2060
+ #define SV_GMAGIC (1 << 1) /* 0x0002 - 2 */
2061
+ #define SV_COW_DROP_PV (1 << 2) /* 0x0004 - 4 */
2062
+ #define SV_FLAG_BIT3_UNUSED (1 << 3) /* 0x0008 - 8 */
2063
+ #define SV_NOSTEAL (1 << 4) /* 0x0010 - 16 */
2064
+ #define SV_CONST_RETURN (1 << 5) /* 0x0020 - 32 */
2065
+ #define SV_MUTABLE_RETURN (1 << 6) /* 0x0040 - 64 */
2066
+ #define SV_SMAGIC (1 << 7) /* 0x0080 - 128 */
2067
+ #define SV_HAS_TRAILING_NUL (1 << 8) /* 0x0100 - 256 */
2068
+ #define SV_COW_SHARED_HASH_KEYS (1 << 9) /* 0x0200 - 512 */
2067
2069
/* This one is only enabled for PERL_OLD_COPY_ON_WRITE */
2068
2070
/* XXX This flag actually enabled for any COW. But it appears not to do
2069
2071
anything. Can we just remove it? Or will it serve some future
2070
2072
purpose. */
2071
- #define SV_COW_OTHER_PVS 1024
2073
+ #define SV_COW_OTHER_PVS (1 << 10) /* 0x0400 - 1024 */
2072
2074
/* Make sv_2pv_flags return NULL if something is undefined. */
2073
- #define SV_UNDEF_RETURNS_NULL 2048
2075
+ #define SV_UNDEF_RETURNS_NULL (1 << 11) /* 0x0800 - 2048 */
2074
2076
/* Tell sv_utf8_upgrade() to not check to see if an upgrade is really needed.
2075
2077
* This is used when the caller has already determined it is, and avoids
2076
2078
* redundant work */
2077
- #define SV_FORCE_UTF8_UPGRADE 4096
2079
+ #define SV_FORCE_UTF8_UPGRADE (1 << 12) /* 0x1000 - 4096 */
2078
2080
/* if (after resolving magic etc), the SV is found to be overloaded,
2079
2081
* don't call the overload magic, just return as-is */
2080
- #define SV_SKIP_OVERLOAD 8192
2081
- #define SV_CATBYTES 16384
2082
- #define SV_CATUTF8 32768
2082
+ #define SV_SKIP_OVERLOAD (1 << 13) /* 0x2000 - 8192 */
2083
+ #define SV_CATBYTES (1 << 14) /* 0x4000 - 16384 */
2084
+ #define SV_CATUTF8 (1 << 15) /* 0x8000 - 32768 */
2083
2085
2084
2086
/* The core is safe for this COW optimisation. XS code on CPAN may not be.
2085
2087
So only default to doing the COW setup if we're in the core.
0 commit comments