Add DEBUG_LEAKING_SCALARS_ABORT, to call abort() if any scalars leak,
authorNicholas Clark <nick@ccl4.org>
Wed, 9 Jan 2008 15:34:42 +0000 (15:34 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 9 Jan 2008 15:34:42 +0000 (15:34 +0000)
or are freed too many times.

p4raw-id: //depot/perl@32918

perl.c
sv.c

diff --git a/perl.c b/perl.c
index 88448de..7856208 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1255,6 +1255,10 @@ perl_destruct(pTHXx)
        close(sock);
     }
 #endif
+#endif
+#ifdef DEBUG_LEAKING_SCALARS_ABORT
+    if (PL_sv_count)
+       abort();
 #endif
     PL_sv_count = 0;
 
diff --git a/sv.c b/sv.c
index 9268e56..5dfbba1 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -5431,6 +5431,9 @@ Perl_sv_free(pTHX_ SV *sv)
   #endif
 #endif
        }
+#ifdef DEBUG_LEAKING_SCALARS_ABORT
+       abort();
+#endif
        return;
     }
     if (--(SvREFCNT(sv)) > 0)