This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Check API compatibility when loading xs modules
authorFlorian Ragwitz <rafl@debian.org>
Tue, 20 Jul 2010 20:58:24 +0000 (22:58 +0200)
committerFlorian Ragwitz <rafl@debian.org>
Mon, 26 Jul 2010 13:48:18 +0000 (15:48 +0200)
commit1e8125c621275d18c74bc8dae3bfc3c03929fe1e
tree787df37aad96d973175f1218677b312e8c8f261e
parent3b462feda21356499e651643c80692cc1c5e6787
Check API compatibility when loading xs modules

This adds PL_apiversion, allowing the API version of a running interpreter to be
introspected. It is used in the new XS_APIVERSION_BOOTCHECK macro, which is
added to the _boot function of every XS module, to compare it against the API
version the module has been compiled against. If the versions do not match, an
exception is thrown.

This doesn't fully prevent binary incompatible extensions to be loaded. It
merely compares PERL_API_* between compile- and runtime, and does not attempt to
solve the problem of identifying binary incompatible perls with the same API
version (i.e. the same perl version configured with and without DEBUGGING).
XSUB.h
cpan/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
embedvar.h
intrpvar.h
perl.c
perl.h
perlapi.h
sv.c