summaryrefslogtreecommitdiff
path: root/XSUB.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-10-08 16:13:38 +0100
committerNicholas Clark <nick@ccl4.org>2010-10-08 16:58:10 +0100
commit379a89070cf5bdcfa33b12551d2c9ef0a3e11418 (patch)
treecb9b0b65bb4e6d39f6ab346c09997551637e148f /XSUB.h
parent88c4b02d8afbe13e65dd6f677f5056354ec301cb (diff)
downloadperl-379a89070cf5bdcfa33b12551d2c9ef0a3e11418.tar.gz
Convert the implementation of XS_APIVERSION_BOOTCHECK to a function.
The previous macro generated over .5K of object code. This is in every shared object, and is only called once. Hence this change increases the perl binary by about .5K (once), to save .5K for every XS module loaded.
Diffstat (limited to 'XSUB.h')
-rw-r--r--XSUB.h19
1 files changed, 1 insertions, 18 deletions
diff --git a/XSUB.h b/XSUB.h
index 174ce886d6..6906ded1f9 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -304,24 +304,7 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
#endif
#define XS_APIVERSION_BOOTCHECK \
- STMT_START { \
- SV *_xpt = NULL; \
- SV *_compver = Perl_newSVpv(aTHX_ "v" PERL_API_VERSION_STRING, 0); \
- SV *_runver = new_version(PL_apiversion); \
- _compver = upg_version(_compver, 0); \
- if (vcmp(_compver, _runver)) { \
- _xpt = Perl_newSVpvf(aTHX_ "Perl API version %"SVf \
- " of %s does not match %"SVf, \
- SVfARG(Perl_sv_2mortal(aTHX_ vstringify(_compver))), \
- SvPV_nolen_const(ST(0)), \
- SVfARG(Perl_sv_2mortal(aTHX_ vstringify(_runver)))); \
- Perl_sv_2mortal(aTHX_ _xpt); \
- } \
- SvREFCNT_dec(_compver); \
- SvREFCNT_dec(_runver); \
- if (_xpt) \
- Perl_croak_sv(aTHX_ _xpt); \
- } STMT_END
+ Perl_xs_apiversion_bootcheck(aTHX_ ST(0), STR_WITH_LEN("v" PERL_API_VERSION_STRING))
#ifdef NO_XSLOCKS
# define dXCPT dJMPENV; int rEtV = 0