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