diff options
author | Stephen McCamant <smcc@mit.edu> | 1998-07-05 12:36:14 -0500 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-05 23:05:40 +0000 |
commit | 23e6a22f279db8eefd01132a30fcc45ff786ef2a (patch) | |
tree | 5c4e3ff2a632be50e5d47e5f399a574ba6901089 /sv.c | |
parent | 3b02c43c0619d70d7a120dfd99bbe8770f0ea6ca (diff) | |
download | perl-23e6a22f279db8eefd01132a30fcc45ff786ef2a.tar.gz |
patch to remove assumptions about offset of IV being == sizeof(XPV)
Message-ID: <13727.63831.95324.696098@alias-2.pr.mcs.net>
Subject: [PATCH] alignment in X[IN]V allocation
p4raw-id: //depot/perl@1329
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -423,7 +423,7 @@ new_xiv(void) * See comment in more_xiv() -- RAM. */ xiv_root = *(IV**)xiv; - return (XPVIV*)((char*)xiv - sizeof(XPV)); + return (XPVIV*)((char*)xiv - STRUCT_OFFSET(XPVIV, xiv_iv)); } return more_xiv(); } @@ -431,7 +431,7 @@ new_xiv(void) STATIC void del_xiv(XPVIV *p) { - IV* xiv = (IV*)((char*)(p) + sizeof(XPV)); + IV* xiv = (IV*)((char*)(p) + STRUCT_OFFSET(XPVIV, xiv_iv)); *(IV**)xiv = xiv_root; xiv_root = xiv; } @@ -465,7 +465,7 @@ new_xnv(void) if (xnv_root) { xnv = xnv_root; xnv_root = *(double**)xnv; - return (XPVNV*)((char*)xnv - sizeof(XPVIV)); + return (XPVNV*)((char*)xnv - STRUCT_OFFSET(XPVNV, xnv_nv)); } return more_xnv(); } @@ -473,7 +473,7 @@ new_xnv(void) STATIC void del_xnv(XPVNV *p) { - double* xnv = (double*)((char*)(p) + sizeof(XPVIV)); + double* xnv = (double*)((char*)(p) + STRUCT_OFFSET(XPVNV, xnv_nv)); *(double**)xnv = xnv_root; xnv_root = xnv; } |