_SV_HEAD(void*);
_SV_HEAD_UNION;
#ifdef DEBUG_LEAKING_SCALARS
- unsigned sv_debug_optype:9; /* the type of OP that allocated us */
- unsigned sv_debug_inpad:1; /* was allocated in a pad for an OP */
- unsigned sv_debug_cloned:1; /* was cloned for an ithread */
- unsigned sv_debug_line:16; /* the line where we were allocated */
+ PERL_BITFIELD32 sv_debug_optype:9; /* the type of OP that allocated us */
+ PERL_BITFIELD32 sv_debug_inpad:1; /* was allocated in a pad for an OP */
+ PERL_BITFIELD32 sv_debug_cloned:1; /* was cloned for an ithread */
+ PERL_BITFIELD32 sv_debug_line:16; /* the line where we were allocated */
char * sv_debug_file; /* the file where we were allocated */
#endif
};
#define SvFLAGS(sv) (sv)->sv_flags
#define SvREFCNT(sv) (sv)->sv_refcnt
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(PERL_GCC_PEDANTIC)
+#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
# define SvREFCNT_inc(sv) \
({ \
SV * const _sv = (SV*)(sv); \
#define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
#define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(PERL_GCC_PEDANTIC)
+#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
# define SvREFCNT_dec(sv) \
({ \
SV * const _sv = (SV*)(sv); \
3: For PVCV, whether CvUNIQUE(cv)
refers to an eval or once only
[CvEVAL(cv), CvSPECIAL(cv)]
- 4: Whether the regexp pointer is in
- fact an offset [SvREPADTMP(sv)]
- 5: On a pad name SV, that slot in the
+ 4: On a pad name SV, that slot in the
frame AV is a REFCNT'ed reference
to a lexical from "outside". */
-#define SVphv_REHASH SVf_FAKE /* 6: On a PVHV, hash values are being
+#define SVphv_REHASH SVf_FAKE /* 5: On a PVHV, hash values are being
recalculated */
#define SVf_OOK 0x02000000 /* has valid offset value. For a PVHV this
means that a hv_aux struct is present
IV xfm_lines;
} xpvfm_allocated;
+#define _XPVIO_TAIL \
+ PerlIO * xio_ifp; /* ifp and ofp are normally the same */ \
+ PerlIO * xio_ofp; /* but sockets need separate streams */ \
+ /* Cray addresses everything by word boundaries (64 bits) and \
+ * code and data pointers cannot be mixed (which is exactly what \
+ * Perl_filter_add() tries to do with the dirp), hence the \
+ * following union trick (as suggested by Gurusamy Sarathy). \
+ * For further information see Geir Johansen's problem report \
+ * titled [ID 20000612.002] Perl problem on Cray system \
+ * The any pointer (known as IoANY()) will also be a good place \
+ * to hang any IO disciplines to. \
+ */ \
+ union { \
+ DIR * xiou_dirp; /* for opendir, readdir, etc */ \
+ void * xiou_any; /* for alignment */ \
+ } xio_dirpu; \
+ IV xio_lines; /* $. */ \
+ IV xio_page; /* $% */ \
+ IV xio_page_len; /* $= */ \
+ IV xio_lines_left; /* $- */ \
+ char * xio_top_name; /* $^ */ \
+ GV * xio_top_gv; /* $^ */ \
+ char * xio_fmt_name; /* $~ */ \
+ GV * xio_fmt_gv; /* $~ */ \
+ char * xio_bottom_name;/* $^B */ \
+ GV * xio_bottom_gv; /* $^B */ \
+ char xio_type; \
+ U8 xio_flags
+
+
struct xpvio {
_XPV_HEAD;
_XPVMG_HEAD;
-
- PerlIO * xio_ifp; /* ifp and ofp are normally the same */
- PerlIO * xio_ofp; /* but sockets need separate streams */
- /* Cray addresses everything by word boundaries (64 bits) and
- * code and data pointers cannot be mixed (which is exactly what
- * Perl_filter_add() tries to do with the dirp), hence the following
- * union trick (as suggested by Gurusamy Sarathy).
- * For further information see Geir Johansen's problem report titled
- [ID 20000612.002] Perl problem on Cray system
- * The any pointer (known as IoANY()) will also be a good place
- * to hang any IO disciplines to.
- */
- union {
- DIR * xiou_dirp; /* for opendir, readdir, etc */
- void * xiou_any; /* for alignment */
- } xio_dirpu;
- IV xio_lines; /* $. */
- IV xio_page; /* $% */
- IV xio_page_len; /* $= */
- IV xio_lines_left; /* $- */
- char * xio_top_name; /* $^ */
- GV * xio_top_gv; /* $^ */
- char * xio_fmt_name; /* $~ */
- GV * xio_fmt_gv; /* $~ */
- char * xio_bottom_name;/* $^B */
- GV * xio_bottom_gv; /* $^B */
- char xio_type;
- U8 xio_flags;
+ _XPVIO_TAIL;
};
+
+typedef struct {
+ _XPV_ALLOCATED_HEAD;
+ _XPVMG_HEAD;
+ _XPVIO_TAIL;
+} xpvio_allocated;
+
#define xio_dirp xio_dirpu.xiou_dirp
#define xio_any xio_dirpu.xiou_any
#define SvTAIL_off(sv) (SvFLAGS(sv) &= ~SVpbm_TAIL)
-#ifdef USE_ITHREADS
-/* The following uses the FAKE flag to show that a regex pointer is infact
- its own offset in the regexpad for ithreads */
-#define SvREPADTMP(sv) (SvFLAGS(sv) & SVf_FAKE)
-#define SvREPADTMP_on(sv) (SvFLAGS(sv) |= SVf_FAKE)
-#define SvREPADTMP_off(sv) (SvFLAGS(sv) &= ~SVf_FAKE)
-#endif
-
#define SvPAD_TYPED(sv) \
((SvFLAGS(sv) & (SVpad_NAME|SVpad_TYPED)) == (SVpad_NAME|SVpad_TYPED))
assert(SvTYPE(_svi) != SVt_PVHV); \
assert(SvTYPE(_svi) != SVt_PVCV); \
assert(SvTYPE(_svi) != SVt_PVFM); \
+ assert(SvTYPE(_svi) != SVt_PVIO); \
assert(!isGV_with_GP(_svi)); \
&(((XPVNV*) SvANY(_svi))->xnv_u.xnv_nv); \
}))
STMT_START { assert(SvTYPE(sv) == SVt_NV || SvTYPE(sv) >= SVt_PVNV); \
assert(SvTYPE(sv) != SVt_PVAV); assert(SvTYPE(sv) != SVt_PVHV); \
assert(SvTYPE(sv) != SVt_PVCV); assert(SvTYPE(sv) != SVt_PVFM); \
+ assert(SvTYPE(sv) != SVt_PVIO); \
assert(!isGV_with_GP(sv)); \
(((XPVNV*)SvANY(sv))->xnv_u.xnv_nv = (val)); } STMT_END
#define SvPV_set(sv, val) \
#define SV_COW_SHARED_HASH_KEYS 512
/* This one is only enabled for PERL_OLD_COPY_ON_WRITE */
#define SV_COW_OTHER_PVS 1024
+/* Make sv_2pv_flags return NULL if something is undefined. */
+#define SV_UNDEF_RETURNS_NULL 2048
/* The core is safe for this COW optimisation. XS code on CPAN may not be.
So only default to doing the COW setup if we're in the core.