summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-04-11 15:23:17 +0100
committerDavid Mitchell <davem@iabyn.com>2010-04-11 15:26:25 +0100
commitd97c33b505dd45c052a8bf42014917701b4502a5 (patch)
tree2167944035ac32eb8b0336db0cbd451ee69aef38 /ext
parent27e904532594b7fb224bdf9a05bf3b5336b8a39e (diff)
downloadperl-d97c33b505dd45c052a8bf42014917701b4502a5.tar.gz
create SV leak test infrastructure
Add an sv_count() function to XS::APItest to allow access to PL_sv_count, then add new test file t/op/svleak.t that allows you yo run a code fragment a few times and test whether the number of allocated SVs has increased
Diffstat (limited to 'ext')
-rw-r--r--ext/XS-APItest/APItest.pm5
-rw-r--r--ext/XS-APItest/APItest.xs7
2 files changed, 10 insertions, 2 deletions
diff --git a/ext/XS-APItest/APItest.pm b/ext/XS-APItest/APItest.pm
index 11766f47ac..b1767931b9 100644
--- a/ext/XS-APItest/APItest.pm
+++ b/ext/XS-APItest/APItest.pm
@@ -24,6 +24,7 @@ our @EXPORT = qw( print_double print_int print_long
sv_setsv_cow_hashkey_core sv_setsv_cow_hashkey_notcore
rmagical_cast rmagical_flags
DPeek utf16_to_utf8 utf16_to_utf8_reversed pmflag my_exit
+ sv_count
);
our $VERSION = '0.17';
@@ -84,8 +85,8 @@ XS::APItest - Test the perl C API
=head1 ABSTRACT
-This module tests the perl C API. Currently tests that C<printf>
-works correctly.
+This module tests the perl C API. Also exposes various bit of the perl
+internals for the use of core test scripts.
=head1 DESCRIPTION
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index ede69949a1..328ddea42f 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -936,3 +936,10 @@ void
my_exit(int exitcode)
PPCODE:
my_exit(exitcode);
+
+I32
+sv_count()
+ CODE:
+ RETVAL = PL_sv_count;
+ OUTPUT:
+ RETVAL