From 3aef5da32a556254a262176f9a5669a7573170f9 Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Tue, 9 Dec 2008 11:33:18 +0100 Subject: [PATCH] * sv_dump is also available with non-debugging perls since 5.6.0 --- Leak.pm | 10 ++++++---- Leak.xs | 2 +- Makefile.PL | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Leak.pm b/Leak.pm index 0024422..26fc276 100644 --- a/Leak.pm +++ b/Leak.pm @@ -3,7 +3,7 @@ use 5.005; use vars qw($VERSION); require DynaLoader; use base qw(DynaLoader); -$VERSION = '0.03'; +$VERSION = '0.04'; bootstrap Devel::Leak; @@ -41,12 +41,14 @@ of "things" now allocated. =head1 CAVEATS -Note that you need a perl built with -DDEBUGGING for -sv_dump() to print anything, but counts are valid in any perl. - If new "things" I been created, C may (also) report additional "things" which are allocated by the sv_dump() code. +=head1 NOTES + +Note that you perls older than 5.6.0 need to be built with -DDEBUGGING +for sv_dump() to print anything, but counts are valid in any perl. + =head1 HISTORY This little utility module was part of Tk until the variable renaming diff --git a/Leak.xs b/Leak.xs index c41b2ad..59b2390 100644 --- a/Leak.xs +++ b/Leak.xs @@ -11,7 +11,7 @@ typedef long used_proc _((void *,SV *,long)); typedef struct hash_s *hash_ptr; -#ifndef DEBUGGING +#ifndef sv_dump #define sv_dump(sv) PerlIO_printf(PerlIO_stderr(), "\n") #endif diff --git a/Makefile.PL b/Makefile.PL index 40731a2..2d55347 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,7 +1,7 @@ use ExtUtils::MakeMaker; use Config; -unless ($Config{'ccflags'} =~ /-DDEBUGGING/) +if ($] < 5.006 && $Config{'ccflags'} !~ /-DDEBUGGING/) { warn "This perl is not compiled with -DDEBUGGING - functions restricted\n"; } -- 2.11.4.GIT