Change 33069 by [EMAIL PROTECTED] on 2008/01/25 22:29:14
PVIOs don't need space for SvNVX allocated.
Affected files ...
... //depot/perl/sv.c#1497 edit
... //depot/perl/sv.h#343 edit
Differences ...
==== //depot/perl/sv.c#1497 (text) ====
Index: perl/sv.c
--- perl/sv.c#1496~33063~ 2008-01-24 05:57:20.000000000 -0800
+++ perl/sv.c 2008-01-25 14:29:14.000000000 -0800
@@ -953,8 +953,9 @@
SVt_PVFM, TRUE, NONV, NOARENA, FIT_ARENA(20, sizeof(xpvfm_allocated)) },
/* XPVIO is 84 bytes, fits 48x */
- { sizeof(XPVIO), sizeof(XPVIO), 0, SVt_PVIO, TRUE, HADNV,
- HASARENA, FIT_ARENA(24, sizeof(XPVIO)) },
+ { sizeof(xpvio_allocated), sizeof(xpvio_allocated),
+ + relative_STRUCT_OFFSET(xpvio_allocated, XPVIO, xpv_cur),
+ SVt_PVIO, TRUE, NONV, HASARENA, FIT_ARENA(24, sizeof(xpvio_allocated)) },
};
#define new_body_type(sv_type) \
==== //depot/perl/sv.h#343 (text) ====
Index: perl/sv.h
--- perl/sv.h#342~32969~ 2008-01-12 14:20:39.000000000 -0800
+++ perl/sv.h 2008-01-25 14:29:14.000000000 -0800
@@ -532,38 +532,48 @@
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
@@ -1103,6 +1113,7 @@
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); \
}))
@@ -1177,6 +1188,7 @@
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) \
End of Patch.