diff options
author | David Mitchell <davem@iabyn.com> | 2015-12-04 15:50:54 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-02-03 09:18:33 +0000 |
commit | 82fce3d0db4e7411638fbe6cc1575a02021a5726 (patch) | |
tree | e9bf1ce478f983c6927de87e1737fd8837db622a /sv.c | |
parent | 991bab54b4e8079e992d43fe5a07d8f38ed940a3 (diff) | |
download | perl-82fce3d0db4e7411638fbe6cc1575a02021a5726.tar.gz |
move SET_SVANY_FOR_BODYLESS_IV() from sv.c to sv.h
Ditto for SET_SVANY_FOR_BODYLESS_NV.
The IV variant will shortly be needed in pp_hot.c, so make it
available outside sv.c. For now, protect with #ifdef PERL_CORE,
so as little as possible is changed by this commit.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 28 |
1 files changed, 0 insertions, 28 deletions
@@ -403,34 +403,6 @@ S_del_sv(pTHX_ SV *p) #endif /* DEBUGGING */ -/* - * Bodyless IVs and NVs! - * - * Since 5.9.2, we can avoid allocating a body for SVt_IV-type SVs. - * Since the larger IV-holding variants of SVs store their integer - * values in their respective bodies, the family of SvIV() accessor - * macros would naively have to branch on the SV type to find the - * integer value either in the HEAD or BODY. In order to avoid this - * expensive branch, a clever soul has deployed a great hack: - * We set up the SvANY pointer such that instead of pointing to a - * real body, it points into the memory before the location of the - * head. We compute this pointer such that the location of - * the integer member of the hypothetical body struct happens to - * be the same as the location of the integer member of the bodyless - * SV head. This now means that the SvIV() family of accessors can - * always read from the (hypothetical or real) body via SvANY. - * - * Since the 5.21 dev series, we employ the same trick for NVs - * if the architecture can support it (NVSIZE <= IVSIZE). - */ - -/* The following two macros compute the necessary offsets for the above - * trick and store them in SvANY for SvIV() (and friends) to use. */ -#define SET_SVANY_FOR_BODYLESS_IV(sv) \ - SvANY(sv) = (XPVIV*)((char*)&(sv->sv_u.svu_iv) - STRUCT_OFFSET(XPVIV, xiv_iv)) - -#define SET_SVANY_FOR_BODYLESS_NV(sv) \ - SvANY(sv) = (XPVNV*)((char*)&(sv->sv_u.svu_nv) - STRUCT_OFFSET(XPVNV, xnv_u.xnv_nv)) /* =head1 SV Manipulation Functions |