summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-08-14 16:46:20 +0100
committerNicholas Clark <nick@ccl4.org>2010-08-14 16:46:20 +0100
commitbc337e5c08fd3b2fb5063efa582bb40d199419b1 (patch)
treec67c8691bfc5a7eed9c4330ca67ae8b435d44e65 /sv.c
parent1fd8fa480e535be8885c2c1b2e7e95c3aabbdf7f (diff)
downloadperl-bc337e5c08fd3b2fb5063efa582bb40d199419b1.tar.gz
Properly reinstate space optimisations to SV body structures.
889d28b2ea2c1751 was incomplete; XPV, XPVIV and XPVNV were returning pointers correctly offset within the allocated space to align the structures consistent with XPVMG, but were allocating the full length, not just the used parts.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sv.c b/sv.c
index 1f66e5b393..52864d21e8 100644
--- a/sv.c
+++ b/sv.c
@@ -920,7 +920,7 @@ static const struct body_details bodies_by_type[] = {
SVt_NV, FALSE, HADNV, HASARENA, FIT_ARENA(0, sizeof(NV)) },
/* 8 bytes on most ILP32 with IEEE doubles */
- { sizeof(XPV),
+ { sizeof(XPV) - STRUCT_OFFSET(XPV, xpv_cur),
copy_length(XPV, xpv_len) - STRUCT_OFFSET(XPV, xpv_cur),
+ STRUCT_OFFSET(XPV, xpv_cur),
SVt_PV, FALSE, NONV, HASARENA,
@@ -928,7 +928,7 @@ static const struct body_details bodies_by_type[] = {
#if 2 *PTRSIZE <= IVSIZE
/* 12 */
- { sizeof(XPVIV),
+ { sizeof(XPVIV) - STRUCT_OFFSET(XPV, xpv_cur),
copy_length(XPVIV, xiv_u) - STRUCT_OFFSET(XPV, xpv_cur),
+ STRUCT_OFFSET(XPV, xpv_cur),
SVt_PVIV, FALSE, NONV, HASARENA,
@@ -944,7 +944,7 @@ static const struct body_details bodies_by_type[] = {
#if (2 *PTRSIZE <= IVSIZE) && (2 *PTRSIZE <= NVSIZE)
/* 20 */
- { sizeof(XPVNV),
+ { sizeof(XPVNV) - STRUCT_OFFSET(XPV, xpv_cur),
copy_length(XPVNV, xnv_u) - STRUCT_OFFSET(XPV, xpv_cur),
+ STRUCT_OFFSET(XPV, xpv_cur),
SVt_PVNV, FALSE, HADNV, HASARENA,