diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-09 15:34:42 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-09 15:34:42 +0000 |
commit | 77abb4c6071dd96d341a4a949cb8d41da13b96fd (patch) | |
tree | 9fefd8702e4f7303240c48bb4052adcad7a5d771 | |
parent | c90cd22b2f0d69bba1abd4ca7cd7ece1531bbb93 (diff) | |
download | perl-77abb4c6071dd96d341a4a949cb8d41da13b96fd.tar.gz |
Add DEBUG_LEAKING_SCALARS_ABORT, to call abort() if any scalars leak,
or are freed too many times.
p4raw-id: //depot/perl@32918
-rw-r--r-- | perl.c | 4 | ||||
-rw-r--r-- | sv.c | 3 |
2 files changed, 7 insertions, 0 deletions
@@ -1256,6 +1256,10 @@ perl_destruct(pTHXx) } #endif #endif +#ifdef DEBUG_LEAKING_SCALARS_ABORT + if (PL_sv_count) + abort(); +#endif PL_sv_count = 0; #ifdef PERL_DEBUG_READONLY_OPS @@ -5431,6 +5431,9 @@ Perl_sv_free(pTHX_ SV *sv) #endif #endif } +#ifdef DEBUG_LEAKING_SCALARS_ABORT + abort(); +#endif return; } if (--(SvREFCNT(sv)) > 0) |