summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-01-25 13:30:16 +0000
committerNicholas Clark <nick@ccl4.org>2010-05-21 07:03:51 +0100
commit889d28b2ea2c17517fae97cf4a92bd3563aaa74f (patch)
tree0bb42492ae6b2444fbfc791ef943d6d43e536d33 /sv.c
parent6e1287864cd02fb6f429f12a995e1c08e03572b9 (diff)
downloadperl-889d28b2ea2c17517fae97cf4a92bd3563aaa74f.tar.gz
Reinstate space optimisations to SV body structures.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 016a1420c1..3b332f267e 100644
--- a/sv.c
+++ b/sv.c
@@ -921,21 +921,39 @@ static const struct body_details bodies_by_type[] = {
/* 8 bytes on most ILP32 with IEEE doubles */
{ sizeof(XPV),
- copy_length(XPV, xpv_len),
- 0,
+ copy_length(XPV, xpv_len) - STRUCT_OFFSET(XPV, xpv_cur),
+ + STRUCT_OFFSET(XPV, xpv_cur),
SVt_PV, FALSE, NONV, HASARENA,
- FIT_ARENA(0, sizeof(XPV)) },
+ FIT_ARENA(0, sizeof(XPV) - STRUCT_OFFSET(XPV, xpv_cur)) },
+#if 2 *PTRSIZE <= IVSIZE
/* 12 */
{ sizeof(XPVIV),
+ copy_length(XPVIV, xiv_u) - STRUCT_OFFSET(XPV, xpv_cur),
+ + STRUCT_OFFSET(XPV, xpv_cur),
+ SVt_PVIV, FALSE, NONV, HASARENA,
+ FIT_ARENA(0, sizeof(XPVIV) - STRUCT_OFFSET(XPV, xpv_cur)) },
+ /* 12 */
+#else
+ { sizeof(XPVIV),
copy_length(XPVIV, xiv_u),
0,
SVt_PVIV, FALSE, NONV, HASARENA,
- FIT_ARENA(0, sizeof(XPV)) },
+ FIT_ARENA(0, sizeof(XPVIV)) },
+#endif
+#if (2 *PTRSIZE <= IVSIZE) && (2 *PTRSIZE <= NVSIZE)
+ /* 20 */
+ { sizeof(XPVNV),
+ copy_length(XPVNV, xnv_u) - STRUCT_OFFSET(XPV, xpv_cur),
+ + STRUCT_OFFSET(XPV, xpv_cur),
+ SVt_PVNV, FALSE, HADNV, HASARENA,
+ FIT_ARENA(0, sizeof(XPVNV) - STRUCT_OFFSET(XPV, xpv_cur)) },
+#else
/* 20 */
{ sizeof(XPVNV), copy_length(XPVNV, xnv_u), 0, SVt_PVNV, FALSE, HADNV,
HASARENA, FIT_ARENA(0, sizeof(XPVNV)) },
+#endif
/* 28 */
{ sizeof(XPVMG), copy_length(XPVMG, xnv_u), 0, SVt_PVMG, FALSE, HADNV,