Last active
August 29, 2015 13:58
-
-
Save scottwalters/10001986 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copyright (c) 1997-1998 Nick Ing-Simmons. All rights reserved. | |
This program is free software; you can redistribute it and/or | |
modify it under the same terms as Perl itself. | |
This module provides a basic way to discover if a piece of perl code | |
is allocating perl data and not releasing them again. | |
You install this package using CPAN.pm or the normal: | |
perl Makefile.PL | |
make | |
make test | |
make install | |
process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo rm -rf Leak.bs blib | |
make | |
sudo rm -rf /usr/local/lib/perl5/site_perl/5.19.9/i686-linux/auto/Devel/Leak \ | |
/usr/local/lib/perl5/site_perl/5.19.9/i686-linux/auto/Devel/Leak/Leak.so \ | |
/usr/local/lib/perl5/site_perl/5.19.9/i686-linux/auto/Devel/Leak/.packlist | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Devel::Leak; | |
use 5.005; | |
use vars qw($VERSION); | |
require DynaLoader; | |
use base qw(DynaLoader); | |
$VERSION = '0.04'; | |
bootstrap Devel::Leak; | |
1; | |
__END__ | |
=head1 NAME | |
Devel::Leak - Utility for looking for perl objects that are not reclaimed. | |
=head1 SYNOPSIS | |
use Devel::Leak; | |
... setup code | |
my $count = Devel::Leak::NoteSV($handle); | |
... code that may leak | |
Devel::Leak::CheckSV($handle); | |
=head1 DESCRIPTION | |
Devel::Leak has two functions C<NoteSV> and C<CheckSV>. | |
C<NoteSV> walks the perl internal table of allocated SVs (scalar values) - (which | |
actually contains arrays and hashes too), and records their addresses in a | |
table. It returns a count of these "things", and stores a pointer to the | |
table (which is obtained from the heap using malloc()) in its argument. | |
C<CheckSV> is passed argument which holds a pointer to a table created by | |
C<NoteSV>. It re-walks the perl-internals and calls sv_dump() for any "things" | |
which did not exist when C<NoteSV> was called. It returns a count of the number | |
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<have> been created, C<CheckSV> may (also) report additional | |
"things" which are allocated by the sv_dump() code. | |
=head1 HISTORY | |
This little utility module was part of Tk until the variable renaming | |
in perl5.005 made it clear that Tk had no business knowing this much | |
about the perl internals. | |
=head1 AUTHOR | |
Nick Ing-Simmons <nick@ni-s.u-net.com> | |
=cut | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (c) 1995,1996-1998 Nick Ing-Simmons. All rights reserved. | |
This program is free software; you can redistribute it and/or | |
modify it under the same terms as Perl itself. | |
*/ | |
#include <EXTERN.h> | |
#include <perl.h> | |
#include <XSUB.h> | |
typedef long used_proc _((void *,SV *,long)); | |
typedef struct hash_s *hash_ptr; | |
#define MAX_HASH 1009 | |
static hash_ptr pile = NULL; | |
struct hash_s | |
{struct hash_s *link; | |
SV *sv; | |
char *tag; | |
}; | |
static char * | |
lookup(hash_ptr *ht, SV *sv, void *tag) | |
{unsigned hash = ((unsigned long) sv) % MAX_HASH; | |
hash_ptr p = ht[hash]; | |
while (p) | |
{ | |
if (p->sv == sv) | |
{char *old = p->tag; | |
p->tag = tag; | |
return old; | |
} | |
p = p->link; | |
} | |
if ((p = pile)) | |
pile = p->link; | |
else | |
p = (hash_ptr) malloc(sizeof(struct hash_s)); | |
p->link = ht[hash]; | |
p->sv = sv; | |
p->tag = tag; | |
ht[hash] = p; | |
return NULL; | |
} | |
void | |
check_arenas() | |
{ | |
SV *sva; | |
for (sva = PL_sv_arenaroot; sva; sva = (SV *) SvANY(sva)) | |
{ | |
SV *sv = sva + 1; | |
SV *svend = &sva[SvREFCNT(sva)]; | |
while (sv < svend) | |
{ | |
if (SvROK(sv) && ((IV) SvANY(sv)) & 1) | |
{ | |
warn("Odd SvANY for %p @ %p[%d]",sv,sva,(sv-sva)); | |
abort(); | |
} | |
++sv; | |
} | |
} | |
} | |
long int | |
sv_apply_to_used(p, proc,n) | |
void *p; | |
used_proc *proc; | |
long int n; | |
{ | |
SV *sva; | |
for (sva = PL_sv_arenaroot; sva; sva = (SV *) SvANY(sva)) | |
{ | |
SV *sv = sva + 1; | |
SV *svend = &sva[SvREFCNT(sva)]; | |
while (sv < svend) | |
{ | |
if (SvTYPE(sv) != SVTYPEMASK) | |
{ | |
n = (*proc) (p, sv, n); | |
} | |
++sv; | |
} | |
} | |
return n; | |
} | |
static char old[] = "old"; | |
static char new[] = "new"; | |
static long | |
note_sv(p,sv, n) | |
void *p; | |
SV *sv; | |
long int n; | |
{ | |
lookup(p,sv,old); | |
return n+1; | |
} | |
long | |
note_used(hash_ptr **x) | |
{ | |
hash_ptr *ht; | |
Newz(603, ht, MAX_HASH, hash_ptr); | |
*x = ht; | |
return sv_apply_to_used(ht, note_sv, 0); | |
} | |
static long | |
check_sv(void *p, SV *sv, long hwm) | |
{ | |
char *state = lookup(p,sv,new); | |
if (state != old) | |
{ | |
fprintf(stderr,"YYY %s %p : ", state ? state : new, sv); | |
sv_dump(sv); | |
} | |
return hwm+1; | |
} | |
static long | |
find_object(void *p, SV *sv, long count) | |
{ | |
if (sv_isobject(sv)) | |
{ | |
sv_dump(sv); | |
count++; | |
} | |
return count; | |
} | |
MODULE = Devel::Leak PACKAGE = Devel::Leak | |
PROTOTYPES: Enable | |
IV | |
NoteSV(obj) | |
hash_ptr * obj = NO_INIT | |
CODE: | |
{ | |
RETVAL = note_used(&obj); | |
} | |
OUTPUT: | |
obj | |
RETVAL | |
void | |
CheckSV(obj) | |
hash_ptr * obj | |
PPCODE: | |
hash_ptr *ht = obj; | |
// find newly appared SVs in the arena | |
// long count = sv_apply_to_used(ht, check_sv, 0); | |
// from sv_apply_to_used and check_sv stuffed in it | |
SV *sva; | |
for (sva = PL_sv_arenaroot; sva; sva = (SV *) SvANY(sva)) | |
{ | |
SV *sv = sva + 1; | |
SV *svend = &sva[SvREFCNT(sva)]; | |
while (sv < svend) | |
{ | |
if (SvTYPE(sv) != SVTYPEMASK) { | |
// n = (*proc) (p, sv, n); | |
// check_sv(void *p, SV *sv, long hwm) | |
char *state = lookup(ht,sv,new); | |
if (state != old) { | |
fprintf(stderr,"YYYyyy %s %p : ", state ? state : new, sv); | |
SV *ref = newRV_noinc(sv); | |
lookup(ht,ref,old); // mark the newly created reference to hold that scalar as being old so that we don't wind up reporting on it too | |
XPUSHs(ref); | |
// sv_dump(sv); | |
} | |
} | |
++sv; | |
} | |
} | |
// apparently intended to clear out the hash table | |
long i; | |
for (i = 0; i < MAX_HASH; i++) { | |
hash_ptr p = ht[i]; | |
while (p) { | |
hash_ptr t = p; | |
p = t->link; | |
// if (t->tag != new) { | |
//printf("XXX here\n"); | |
// XPUSHs(t->sv); // XXXX | |
// } | |
t->link = pile; | |
pile = t; | |
} | |
} | |
Safefree(ht); | |
// *x = NULL; | |
*obj = NULL; | |
IV | |
FindObjects() | |
CODE: | |
{ | |
RETVAL = sv_apply_to_used(NULL, find_object, 0); | |
} | |
OUTPUT: | |
RETVAL | |
void | |
check_arenas() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This Makefile is for the Devel::Leak extension to perl. | |
# | |
# It was generated automatically by MakeMaker version | |
# 6.30 (Revision: Revision: 4535 ) from the contents of | |
# Makefile.PL. Don't edit this file, edit Makefile.PL instead. | |
# | |
# ANY CHANGES MADE HERE WILL BE LOST! | |
# | |
# MakeMaker ARGV: () | |
# | |
# MakeMaker Parameters: | |
# NAME => q[Devel::Leak] | |
# VERSION_FROM => q[Leak.pm] | |
# clean => { FILES=>q[*% *.bak] } | |
# dist => { COMPRESS=>q[gzip -f9], SUFFIX=>q[.gz] } | |
# --- MakeMaker post_initialize section: | |
# --- MakeMaker const_config section: | |
# These definitions are from config.sh (via /home/knoppix/lib/perl5/5.8.8/i686-linux/Config.pm) | |
# They may have been overridden via Makefile.PL or on the command line | |
AR = ar | |
CC = cc | |
CCCDLFLAGS = -fpic | |
CCDLFLAGS = -Wl,-E | |
DLEXT = so | |
DLSRC = dl_dlopen.xs | |
LD = cc | |
LDDLFLAGS = -shared -L/usr/local/lib | |
LDFLAGS = -L/usr/local/lib | |
LIBC = /lib/libc-2.3.6.so | |
LIB_EXT = .a | |
OBJ_EXT = .o | |
OSNAME = linux | |
OSVERS = 2.4.35.3 | |
RANLIB = : | |
SITELIBEXP = /home/knoppix/lib/perl5/site_perl/5.8.8 | |
SITEARCHEXP = /home/knoppix/lib/perl5/site_perl/5.8.8/i686-linux | |
SO = so | |
EXE_EXT = | |
FULL_AR = /usr/bin/ar | |
VENDORARCHEXP = | |
VENDORLIBEXP = | |
# --- MakeMaker constants section: | |
AR_STATIC_ARGS = cr | |
DIRFILESEP = / | |
DFSEP = $(DIRFILESEP) | |
NAME = Devel::Leak | |
NAME_SYM = Devel_Leak | |
VERSION = 0.03 | |
VERSION_MACRO = VERSION | |
VERSION_SYM = 0_03 | |
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" | |
XS_VERSION = 0.03 | |
XS_VERSION_MACRO = XS_VERSION | |
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" | |
INST_ARCHLIB = blib/arch | |
INST_SCRIPT = blib/script | |
INST_BIN = blib/bin | |
INST_LIB = blib/lib | |
INST_MAN1DIR = blib/man1 | |
INST_MAN3DIR = blib/man3 | |
MAN1EXT = 1 | |
MAN3EXT = 3 | |
INSTALLDIRS = site | |
DESTDIR = | |
PREFIX = $(SITEPREFIX) | |
PERLPREFIX = /home/knoppix | |
SITEPREFIX = /home/knoppix | |
VENDORPREFIX = | |
INSTALLPRIVLIB = /home/knoppix/lib/perl5/5.8.8 | |
DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) | |
INSTALLSITELIB = /home/knoppix/lib/perl5/site_perl/5.8.8 | |
DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) | |
INSTALLVENDORLIB = | |
DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) | |
INSTALLARCHLIB = /home/knoppix/lib/perl5/5.8.8/i686-linux | |
DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) | |
INSTALLSITEARCH = /home/knoppix/lib/perl5/site_perl/5.8.8/i686-linux | |
DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) | |
INSTALLVENDORARCH = | |
DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) | |
INSTALLBIN = /home/knoppix/bin | |
DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) | |
INSTALLSITEBIN = /home/knoppix/bin | |
DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) | |
INSTALLVENDORBIN = | |
DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) | |
INSTALLSCRIPT = /home/knoppix/bin | |
DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) | |
INSTALLMAN1DIR = /home/knoppix/share/man/man1 | |
DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) | |
INSTALLSITEMAN1DIR = /home/knoppix/share/man/man1 | |
DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) | |
INSTALLVENDORMAN1DIR = | |
DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) | |
INSTALLMAN3DIR = /home/knoppix/share/man/man3 | |
DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) | |
INSTALLSITEMAN3DIR = /home/knoppix/share/man/man3 | |
DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) | |
INSTALLVENDORMAN3DIR = | |
DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) | |
PERL_LIB = /home/knoppix/lib/perl5/5.8.8 | |
PERL_ARCHLIB = /home/knoppix/lib/perl5/5.8.8/i686-linux | |
LIBPERL_A = libperl.a | |
FIRST_MAKEFILE = Makefile | |
MAKEFILE_OLD = Makefile.old | |
MAKE_APERL_FILE = Makefile.aperl | |
PERLMAINCC = $(CC) | |
PERL_INC = /home/knoppix/lib/perl5/5.8.8/i686-linux/CORE | |
PERL = /home/knoppix/bin/perl | |
FULLPERL = /home/knoppix/bin/perl | |
ABSPERL = $(PERL) | |
PERLRUN = $(PERL) | |
FULLPERLRUN = $(FULLPERL) | |
ABSPERLRUN = $(ABSPERL) | |
PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" | |
FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" | |
ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" | |
PERL_CORE = 0 | |
PERM_RW = 644 | |
PERM_RWX = 755 | |
MAKEMAKER = /home/knoppix/lib/perl5/5.8.8/ExtUtils/MakeMaker.pm | |
MM_VERSION = 6.30 | |
MM_REVISION = Revision: 4535 | |
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). | |
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) | |
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) | |
# DLBASE = Basename part of dynamic library. May be just equal BASEEXT. | |
FULLEXT = Devel/Leak | |
BASEEXT = Leak | |
PARENT_NAME = Devel | |
DLBASE = $(BASEEXT) | |
VERSION_FROM = Leak.pm | |
OBJECT = $(BASEEXT)$(OBJ_EXT) | |
LDFROM = $(OBJECT) | |
LINKTYPE = dynamic | |
BOOTDEP = | |
# Handy lists of source code files: | |
XS_FILES = Leak.xs | |
C_FILES = Leak.c | |
O_FILES = Leak.o | |
H_FILES = | |
MAN1PODS = | |
MAN3PODS = Leak.pm | |
# Where is the Config information that we are using/depend on | |
CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h | |
# Where to build things | |
INST_LIBDIR = $(INST_LIB)/Devel | |
INST_ARCHLIBDIR = $(INST_ARCHLIB)/Devel | |
INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) | |
INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) | |
INST_STATIC = $(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT) | |
INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(DLBASE).$(DLEXT) | |
INST_BOOT = $(INST_ARCHAUTODIR)/$(BASEEXT).bs | |
# Extra linker info | |
EXPORT_LIST = | |
PERL_ARCHIVE = | |
PERL_ARCHIVE_AFTER = | |
TO_INST_PM = Leak.pm | |
PM_TO_BLIB = Leak.pm \ | |
$(INST_LIB)/Devel/Leak.pm | |
# --- MakeMaker platform_constants section: | |
MM_Unix_VERSION = 1.50 | |
PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc | |
# --- MakeMaker tool_autosplit section: | |
# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto | |
AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)' | |
# --- MakeMaker tool_xsubpp section: | |
XSUBPPDIR = /home/knoppix/lib/perl5/5.8.8/ExtUtils | |
XSUBPP = $(XSUBPPDIR)$(DFSEP)xsubpp | |
XSUBPPRUN = $(PERLRUN) $(XSUBPP) | |
XSPROTOARG = | |
XSUBPPDEPS = /home/knoppix/lib/perl5/5.8.8/ExtUtils/typemap typemap $(XSUBPP) | |
XSUBPPARGS = -typemap /home/knoppix/lib/perl5/5.8.8/ExtUtils/typemap -typemap typemap | |
XSUBPP_EXTRA_ARGS = | |
# --- MakeMaker tools_other section: | |
SHELL = /bin/sh | |
CHMOD = chmod | |
CP = cp | |
MV = mv | |
NOOP = $(SHELL) -c true | |
NOECHO = @ | |
RM_F = rm -f | |
RM_RF = rm -rf | |
TEST_F = test -f | |
TOUCH = touch | |
UMASK_NULL = umask 0 | |
DEV_NULL = > /dev/null 2>&1 | |
MKPATH = $(ABSPERLRUN) "-MExtUtils::Command" -e mkpath | |
EQUALIZE_TIMESTAMP = $(ABSPERLRUN) "-MExtUtils::Command" -e eqtime | |
ECHO = echo | |
ECHO_N = echo -n | |
UNINST = 0 | |
VERBINST = 0 | |
MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install({@ARGV}, '\''$(VERBINST)'\'', 0, '\''$(UNINST)'\'');' | |
DOC_INSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e perllocal_install | |
UNINSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e uninstall | |
WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist | |
MACROSTART = | |
MACROEND = | |
USEMAKEFILE = -f | |
FIXIN = $(PERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)" | |
# --- MakeMaker makemakerdflt section: | |
makemakerdflt: all | |
$(NOECHO) $(NOOP) | |
# --- MakeMaker dist section: | |
TAR = tar | |
TARFLAGS = cvf | |
ZIP = zip | |
ZIPFLAGS = -r | |
COMPRESS = gzip -f9 | |
SUFFIX = .gz | |
SHAR = shar | |
PREOP = $(NOECHO) $(NOOP) | |
POSTOP = $(NOECHO) $(NOOP) | |
TO_UNIX = $(NOECHO) $(NOOP) | |
CI = ci -u | |
RCS_LABEL = rcs -Nv$(VERSION_SYM): -q | |
DIST_CP = best | |
DIST_DEFAULT = tardist | |
DISTNAME = Devel-Leak | |
DISTVNAME = Devel-Leak-0.03 | |
# --- MakeMaker macro section: | |
# --- MakeMaker depend section: | |
# --- MakeMaker cflags section: | |
CCFLAGS = -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 | |
OPTIMIZE = -O2 | |
PERLTYPE = | |
MPOLLUTE = | |
# --- MakeMaker const_loadlibs section: | |
# Devel::Leak might depend on some other libraries: | |
# See ExtUtils::Liblist for details | |
# | |
# --- MakeMaker const_cccmd section: | |
CCCMD = $(CC) -c $(PASTHRU_INC) $(INC) \ | |
$(CCFLAGS) $(OPTIMIZE) \ | |
$(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ | |
$(XS_DEFINE_VERSION) | |
# --- MakeMaker post_constants section: | |
# --- MakeMaker pasthru section: | |
PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ | |
LINKTYPE="$(LINKTYPE)"\ | |
OPTIMIZE="$(OPTIMIZE)"\ | |
PREFIX="$(PREFIX)" | |
# --- MakeMaker special_targets section: | |
.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) | |
.PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir | |
# --- MakeMaker c_o section: | |
.c.i: | |
cc -E -c $(PASTHRU_INC) $(INC) \ | |
$(CCFLAGS) $(OPTIMIZE) \ | |
$(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ | |
$(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i | |
.c.s: | |
$(CCCMD) -S $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c | |
.c$(OBJ_EXT): | |
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c | |
.C$(OBJ_EXT): | |
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.C | |
.cpp$(OBJ_EXT): | |
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cpp | |
.cxx$(OBJ_EXT): | |
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cxx | |
.cc$(OBJ_EXT): | |
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cc | |
# --- MakeMaker xs_c section: | |
.xs.c: | |
$(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $(XSUBPP_EXTRA_ARGS) $*.xs > $*.xsc && $(MV) $*.xsc $*.c | |
# --- MakeMaker xs_o section: | |
.xs$(OBJ_EXT): | |
$(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.xsc && $(MV) $*.xsc $*.c | |
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c | |
# --- MakeMaker top_targets section: | |
all :: pure_all manifypods | |
$(NOECHO) $(NOOP) | |
pure_all :: config pm_to_blib subdirs linkext | |
$(NOECHO) $(NOOP) | |
subdirs :: $(MYEXTLIB) | |
$(NOECHO) $(NOOP) | |
config :: $(FIRST_MAKEFILE) blibdirs | |
$(NOECHO) $(NOOP) | |
help : | |
perldoc ExtUtils::MakeMaker | |
# --- MakeMaker blibdirs section: | |
blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists | |
$(NOECHO) $(NOOP) | |
# Backwards compat with 6.18 through 6.25 | |
blibdirs.ts : blibdirs | |
$(NOECHO) $(NOOP) | |
$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL | |
$(NOECHO) $(MKPATH) $(INST_LIBDIR) | |
$(NOECHO) $(CHMOD) 755 $(INST_LIBDIR) | |
$(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists | |
$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL | |
$(NOECHO) $(MKPATH) $(INST_ARCHLIB) | |
$(NOECHO) $(CHMOD) 755 $(INST_ARCHLIB) | |
$(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists | |
$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL | |
$(NOECHO) $(MKPATH) $(INST_AUTODIR) | |
$(NOECHO) $(CHMOD) 755 $(INST_AUTODIR) | |
$(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists | |
$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL | |
$(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) | |
$(NOECHO) $(CHMOD) 755 $(INST_ARCHAUTODIR) | |
$(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists | |
$(INST_BIN)$(DFSEP).exists :: Makefile.PL | |
$(NOECHO) $(MKPATH) $(INST_BIN) | |
$(NOECHO) $(CHMOD) 755 $(INST_BIN) | |
$(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists | |
$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL | |
$(NOECHO) $(MKPATH) $(INST_SCRIPT) | |
$(NOECHO) $(CHMOD) 755 $(INST_SCRIPT) | |
$(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists | |
$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL | |
$(NOECHO) $(MKPATH) $(INST_MAN1DIR) | |
$(NOECHO) $(CHMOD) 755 $(INST_MAN1DIR) | |
$(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists | |
$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL | |
$(NOECHO) $(MKPATH) $(INST_MAN3DIR) | |
$(NOECHO) $(CHMOD) 755 $(INST_MAN3DIR) | |
$(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists | |
# --- MakeMaker linkext section: | |
linkext :: $(LINKTYPE) | |
$(NOECHO) $(NOOP) | |
# --- MakeMaker dlsyms section: | |
# --- MakeMaker dynamic section: | |
dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT) | |
$(NOECHO) $(NOOP) | |
# --- MakeMaker dynamic_bs section: | |
BOOTSTRAP = $(BASEEXT).bs | |
# As Mkbootstrap might not write a file (if none is required) | |
# we use touch to prevent make continually trying to remake it. | |
# The DynaLoader only reads a non-empty file. | |
$(BOOTSTRAP) : $(FIRST_MAKEFILE) $(BOOTDEP) $(INST_ARCHAUTODIR)$(DFSEP).exists | |
$(NOECHO) $(ECHO) "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))" | |
$(NOECHO) $(PERLRUN) \ | |
"-MExtUtils::Mkbootstrap" \ | |
-e "Mkbootstrap('$(BASEEXT)','$(BSLOADLIBS)');" | |
$(NOECHO) $(TOUCH) $@ | |
$(CHMOD) $(PERM_RW) $@ | |
$(INST_BOOT) : $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).exists | |
$(NOECHO) $(RM_RF) $@ | |
- $(CP) $(BOOTSTRAP) $@ | |
$(CHMOD) $(PERM_RW) $@ | |
# --- MakeMaker dynamic_lib section: | |
# This section creates the dynamically loadable $(INST_DYNAMIC) | |
# from $(OBJECT) and possibly $(MYEXTLIB). | |
ARMAYBE = : | |
OTHERLDFLAGS = | |
INST_DYNAMIC_DEP = | |
INST_DYNAMIC_FIX = | |
$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) | |
$(RM_F) $@ | |
$(LD) $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \ | |
$(PERL_ARCHIVE) $(LDLOADLIBS) $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) \ | |
$(INST_DYNAMIC_FIX) | |
$(CHMOD) $(PERM_RWX) $@ | |
# --- MakeMaker static section: | |
## $(INST_PM) has been moved to the all: target. | |
## It remains here for awhile to allow for old usage: "make static" | |
static :: $(FIRST_MAKEFILE) $(INST_STATIC) | |
$(NOECHO) $(NOOP) | |
# --- MakeMaker static_lib section: | |
$(INST_STATIC) : $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists | |
$(RM_RF) $@ | |
$(FULL_AR) $(AR_STATIC_ARGS) $@ $(OBJECT) && $(RANLIB) $@ | |
$(CHMOD) $(PERM_RWX) $@ | |
$(NOECHO) $(ECHO) "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld | |
# --- MakeMaker manifypods section: | |
POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" | |
POD2MAN = $(POD2MAN_EXE) | |
manifypods : pure_all \ | |
Leak.pm \ | |
Leak.pm | |
$(NOECHO) $(POD2MAN) --section=3 --perm_rw=$(PERM_RW) \ | |
Leak.pm $(INST_MAN3DIR)/Devel::Leak.$(MAN3EXT) | |
# --- MakeMaker processPL section: | |
# --- MakeMaker installbin section: | |
# --- MakeMaker subdirs section: | |
# none | |
# --- MakeMaker clean_subdirs section: | |
clean_subdirs : | |
$(NOECHO) $(NOOP) | |
# --- MakeMaker clean section: | |
# Delete temporary files but do not touch installed files. We don't delete | |
# the Makefile here so a later make realclean still has a makefile to use. | |
clean :: clean_subdirs | |
- $(RM_F) \ | |
*$(LIB_EXT) core \ | |
Leak.c core.[0-9] \ | |
$(INST_ARCHAUTODIR)/extralibs.all core.[0-9][0-9] \ | |
$(BASEEXT).bso pm_to_blib.ts \ | |
core.[0-9][0-9][0-9][0-9] $(BASEEXT).x \ | |
$(BOOTSTRAP) perl$(EXE_EXT) \ | |
tmon.out *$(OBJ_EXT) \ | |
pm_to_blib $(INST_ARCHAUTODIR)/extralibs.ld \ | |
blibdirs.ts core.[0-9][0-9][0-9][0-9][0-9] \ | |
*perl.core core.*perl.*.? \ | |
$(MAKE_APERL_FILE) perl \ | |
$(BASEEXT).def core.[0-9][0-9][0-9] \ | |
mon.out lib$(BASEEXT).def \ | |
perlmain.c perl.exe \ | |
so_locations $(BASEEXT).exp | |
- $(RM_RF) \ | |
*% *.bak \ | |
blib | |
- $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) | |
# --- MakeMaker realclean_subdirs section: | |
realclean_subdirs : | |
$(NOECHO) $(NOOP) | |
# --- MakeMaker realclean section: | |
# Delete temporary files (via clean) and also delete dist files | |
realclean purge :: clean realclean_subdirs | |
- $(RM_F) \ | |
$(OBJECT) $(MAKEFILE_OLD) \ | |
$(FIRST_MAKEFILE) | |
- $(RM_RF) \ | |
$(DISTVNAME) | |
# --- MakeMaker metafile section: | |
metafile : create_distdir | |
$(NOECHO) $(ECHO) Generating META.yml | |
$(NOECHO) $(ECHO) '# http://module-build.sourceforge.net/META-spec.html' > META_new.yml | |
$(NOECHO) $(ECHO) '#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#' >> META_new.yml | |
$(NOECHO) $(ECHO) 'name: Devel-Leak' >> META_new.yml | |
$(NOECHO) $(ECHO) 'version: 0.03' >> META_new.yml | |
$(NOECHO) $(ECHO) 'version_from: Leak.pm' >> META_new.yml | |
$(NOECHO) $(ECHO) 'installdirs: site' >> META_new.yml | |
$(NOECHO) $(ECHO) 'requires:' >> META_new.yml | |
$(NOECHO) $(ECHO) '' >> META_new.yml | |
$(NOECHO) $(ECHO) 'distribution_type: module' >> META_new.yml | |
$(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.30' >> META_new.yml | |
-$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml | |
# --- MakeMaker signature section: | |
signature : | |
cpansign -s | |
# --- MakeMaker dist_basics section: | |
distclean :: realclean distcheck | |
$(NOECHO) $(NOOP) | |
distcheck : | |
$(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck | |
skipcheck : | |
$(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck | |
manifest : | |
$(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest | |
veryclean : realclean | |
$(RM_F) *~ *.orig */*~ */*.orig | |
# --- MakeMaker dist_core section: | |
dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) | |
$(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \ | |
-e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' | |
tardist : $(DISTVNAME).tar$(SUFFIX) | |
$(NOECHO) $(NOOP) | |
uutardist : $(DISTVNAME).tar$(SUFFIX) | |
uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu | |
$(DISTVNAME).tar$(SUFFIX) : distdir | |
$(PREOP) | |
$(TO_UNIX) | |
$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME) | |
$(RM_RF) $(DISTVNAME) | |
$(COMPRESS) $(DISTVNAME).tar | |
$(POSTOP) | |
zipdist : $(DISTVNAME).zip | |
$(NOECHO) $(NOOP) | |
$(DISTVNAME).zip : distdir | |
$(PREOP) | |
$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) | |
$(RM_RF) $(DISTVNAME) | |
$(POSTOP) | |
shdist : distdir | |
$(PREOP) | |
$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar | |
$(RM_RF) $(DISTVNAME) | |
$(POSTOP) | |
# --- MakeMaker distdir section: | |
create_distdir : | |
$(RM_RF) $(DISTVNAME) | |
$(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ | |
-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" | |
distdir : create_distdir distmeta | |
$(NOECHO) $(NOOP) | |
# --- MakeMaker dist_test section: | |
disttest : distdir | |
cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL | |
cd $(DISTVNAME) && $(MAKE) $(PASTHRU) | |
cd $(DISTVNAME) && $(MAKE) test $(PASTHRU) | |
# --- MakeMaker dist_ci section: | |
ci : | |
$(PERLRUN) "-MExtUtils::Manifest=maniread" \ | |
-e "@all = keys %{ maniread() };" \ | |
-e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \ | |
-e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});" | |
# --- MakeMaker distmeta section: | |
distmeta : create_distdir metafile | |
$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \ | |
-e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"' | |
# --- MakeMaker distsignature section: | |
distsignature : create_distdir | |
$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \ | |
-e ' or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"' | |
$(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE | |
cd $(DISTVNAME) && cpansign -s | |
# --- MakeMaker install section: | |
install :: all pure_install doc_install | |
$(NOECHO) $(NOOP) | |
install_perl :: all pure_perl_install doc_perl_install | |
$(NOECHO) $(NOOP) | |
install_site :: all pure_site_install doc_site_install | |
$(NOECHO) $(NOOP) | |
install_vendor :: all pure_vendor_install doc_vendor_install | |
$(NOECHO) $(NOOP) | |
pure_install :: pure_$(INSTALLDIRS)_install | |
$(NOECHO) $(NOOP) | |
doc_install :: doc_$(INSTALLDIRS)_install | |
$(NOECHO) $(NOOP) | |
pure__install : pure_site_install | |
$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site | |
doc__install : doc_site_install | |
$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site | |
pure_perl_install :: | |
$(NOECHO) $(MOD_INSTALL) \ | |
read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \ | |
write $(DESTINSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \ | |
$(INST_LIB) $(DESTINSTALLPRIVLIB) \ | |
$(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \ | |
$(INST_BIN) $(DESTINSTALLBIN) \ | |
$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ | |
$(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \ | |
$(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) | |
$(NOECHO) $(WARN_IF_OLD_PACKLIST) \ | |
$(SITEARCHEXP)/auto/$(FULLEXT) | |
pure_site_install :: | |
$(NOECHO) $(MOD_INSTALL) \ | |
read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \ | |
write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \ | |
$(INST_LIB) $(DESTINSTALLSITELIB) \ | |
$(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \ | |
$(INST_BIN) $(DESTINSTALLSITEBIN) \ | |
$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ | |
$(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \ | |
$(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) | |
$(NOECHO) $(WARN_IF_OLD_PACKLIST) \ | |
$(PERL_ARCHLIB)/auto/$(FULLEXT) | |
pure_vendor_install :: | |
$(NOECHO) $(MOD_INSTALL) \ | |
read $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist \ | |
write $(DESTINSTALLVENDORARCH)/auto/$(FULLEXT)/.packlist \ | |
$(INST_LIB) $(DESTINSTALLVENDORLIB) \ | |
$(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \ | |
$(INST_BIN) $(DESTINSTALLVENDORBIN) \ | |
$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ | |
$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \ | |
$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) | |
doc_perl_install :: | |
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod | |
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) | |
-$(NOECHO) $(DOC_INSTALL) \ | |
"Module" "$(NAME)" \ | |
"installed into" "$(INSTALLPRIVLIB)" \ | |
LINKTYPE "$(LINKTYPE)" \ | |
VERSION "$(VERSION)" \ | |
EXE_FILES "$(EXE_FILES)" \ | |
>> $(DESTINSTALLARCHLIB)/perllocal.pod | |
doc_site_install :: | |
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod | |
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) | |
-$(NOECHO) $(DOC_INSTALL) \ | |
"Module" "$(NAME)" \ | |
"installed into" "$(INSTALLSITELIB)" \ | |
LINKTYPE "$(LINKTYPE)" \ | |
VERSION "$(VERSION)" \ | |
EXE_FILES "$(EXE_FILES)" \ | |
>> $(DESTINSTALLARCHLIB)/perllocal.pod | |
doc_vendor_install :: | |
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod | |
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) | |
-$(NOECHO) $(DOC_INSTALL) \ | |
"Module" "$(NAME)" \ | |
"installed into" "$(INSTALLVENDORLIB)" \ | |
LINKTYPE "$(LINKTYPE)" \ | |
VERSION "$(VERSION)" \ | |
EXE_FILES "$(EXE_FILES)" \ | |
>> $(DESTINSTALLARCHLIB)/perllocal.pod | |
uninstall :: uninstall_from_$(INSTALLDIRS)dirs | |
$(NOECHO) $(NOOP) | |
uninstall_from_perldirs :: | |
$(NOECHO) $(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist | |
uninstall_from_sitedirs :: | |
$(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist | |
uninstall_from_vendordirs :: | |
$(NOECHO) $(UNINSTALL) $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist | |
# --- MakeMaker force section: | |
# Phony target to force checking subdirectories. | |
FORCE: | |
$(NOECHO) $(NOOP) | |
# --- MakeMaker perldepend section: | |
PERL_HDRS = \ | |
$(PERL_INC)/EXTERN.h \ | |
$(PERL_INC)/INTERN.h \ | |
$(PERL_INC)/XSUB.h \ | |
$(PERL_INC)/av.h \ | |
$(PERL_INC)/cc_runtime.h \ | |
$(PERL_INC)/config.h \ | |
$(PERL_INC)/cop.h \ | |
$(PERL_INC)/cv.h \ | |
$(PERL_INC)/dosish.h \ | |
$(PERL_INC)/embed.h \ | |
$(PERL_INC)/embedvar.h \ | |
$(PERL_INC)/fakethr.h \ | |
$(PERL_INC)/form.h \ | |
$(PERL_INC)/gv.h \ | |
$(PERL_INC)/handy.h \ | |
$(PERL_INC)/hv.h \ | |
$(PERL_INC)/intrpvar.h \ | |
$(PERL_INC)/iperlsys.h \ | |
$(PERL_INC)/keywords.h \ | |
$(PERL_INC)/mg.h \ | |
$(PERL_INC)/nostdio.h \ | |
$(PERL_INC)/op.h \ | |
$(PERL_INC)/opcode.h \ | |
$(PERL_INC)/patchlevel.h \ | |
$(PERL_INC)/perl.h \ | |
$(PERL_INC)/perlio.h \ | |
$(PERL_INC)/perlsdio.h \ | |
$(PERL_INC)/perlsfio.h \ | |
$(PERL_INC)/perlvars.h \ | |
$(PERL_INC)/perly.h \ | |
$(PERL_INC)/pp.h \ | |
$(PERL_INC)/pp_proto.h \ | |
$(PERL_INC)/proto.h \ | |
$(PERL_INC)/regcomp.h \ | |
$(PERL_INC)/regexp.h \ | |
$(PERL_INC)/regnodes.h \ | |
$(PERL_INC)/scope.h \ | |
$(PERL_INC)/sv.h \ | |
$(PERL_INC)/thrdvar.h \ | |
$(PERL_INC)/thread.h \ | |
$(PERL_INC)/unixish.h \ | |
$(PERL_INC)/util.h | |
$(OBJECT) : $(PERL_HDRS) | |
Leak.c : $(XSUBPPDEPS) | |
# --- MakeMaker makefile section: | |
$(OBJECT) : $(FIRST_MAKEFILE) | |
# We take a very conservative approach here, but it's worth it. | |
# We move Makefile to Makefile.old here to avoid gnu make looping. | |
$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) | |
$(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" | |
$(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." | |
-$(NOECHO) $(RM_F) $(MAKEFILE_OLD) | |
-$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) | |
- $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) | |
$(PERLRUN) Makefile.PL | |
$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" | |
$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" | |
false | |
# --- MakeMaker staticmake section: | |
# --- MakeMaker makeaperl section --- | |
MAP_TARGET = perl | |
FULLPERL = /home/knoppix/bin/perl | |
$(MAP_TARGET) :: static $(MAKE_APERL_FILE) | |
$(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@ | |
$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib | |
$(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) | |
$(NOECHO) $(PERLRUNINST) \ | |
Makefile.PL DIR= \ | |
MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ | |
MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= | |
# --- MakeMaker test section: | |
TEST_VERBOSE=0 | |
TEST_TYPE=test_$(LINKTYPE) | |
TEST_FILE = test.pl | |
TEST_FILES = t/*.t | |
TESTDB_SW = -d | |
testdb :: testdb_$(LINKTYPE) | |
test :: $(TEST_TYPE) | |
test_dynamic :: pure_all | |
PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) | |
testdb_dynamic :: pure_all | |
PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) | |
test_ : test_dynamic | |
test_static :: pure_all $(MAP_TARGET) | |
PERL_DL_NONLAZY=1 ./$(MAP_TARGET) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) | |
testdb_static :: pure_all $(MAP_TARGET) | |
PERL_DL_NONLAZY=1 ./$(MAP_TARGET) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) | |
# --- MakeMaker ppd section: | |
# Creates a PPD (Perl Package Description) for a binary distribution. | |
ppd: | |
$(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="0,03,0,0">' > $(DISTNAME).ppd | |
$(NOECHO) $(ECHO) ' <TITLE>$(DISTNAME)</TITLE>' >> $(DISTNAME).ppd | |
$(NOECHO) $(ECHO) ' <ABSTRACT></ABSTRACT>' >> $(DISTNAME).ppd | |
$(NOECHO) $(ECHO) ' <AUTHOR></AUTHOR>' >> $(DISTNAME).ppd | |
$(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> $(DISTNAME).ppd | |
$(NOECHO) $(ECHO) ' <OS NAME="$(OSNAME)" />' >> $(DISTNAME).ppd | |
$(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="i686-linux" />' >> $(DISTNAME).ppd | |
$(NOECHO) $(ECHO) ' <CODEBASE HREF="" />' >> $(DISTNAME).ppd | |
$(NOECHO) $(ECHO) ' </IMPLEMENTATION>' >> $(DISTNAME).ppd | |
$(NOECHO) $(ECHO) '</SOFTPKG>' >> $(DISTNAME).ppd | |
# --- MakeMaker pm_to_blib section: | |
pm_to_blib : $(TO_INST_PM) | |
$(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')' \ | |
Leak.pm $(INST_LIB)/Devel/Leak.pm | |
$(NOECHO) $(TOUCH) pm_to_blib | |
# --- MakeMaker selfdocument section: | |
# --- MakeMaker postamble section: | |
# End. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use ExtUtils::MakeMaker; | |
use Config; | |
unless ($Config{'ccflags'} =~ /-DDEBUGGING/) | |
{ | |
warn "This perl is not compiled with -DDEBUGGING - functions restricted\n"; | |
} | |
WriteMakefile( | |
'NAME' => 'Devel::Leak', | |
'clean' => {FILES => "*% *.bak"}, | |
'dist' => { COMPRESS => 'gzip -f9', SUFFIX => '.gz' }, | |
'VERSION_FROM' => 'Leak.pm' | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Leak.pm The perl part (with the docs as pod) | |
Leak.xs C code | |
MANIFEST This file | |
MANIFEST.SKIP Things to to list here | |
Makefile.PL How to build it | |
README Description of package | |
t/basic.t A Basic test | |
typemap How our C structures get stored as perl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\bblib\b | |
%$ | |
\.(bak|old|o|c|bs|gz)$ | |
\b(pm_to_blib|Makefile)$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"abstract" : "unknown", | |
"author" : [ | |
"unknown" | |
], | |
"dynamic_config" : 0, | |
"generated_by" : "ExtUtils::MakeMaker version 6.88, CPAN::Meta::Converter version 2.133380", | |
"license" : [ | |
"unknown" | |
], | |
"meta-spec" : { | |
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", | |
"version" : "2" | |
}, | |
"name" : "Devel-Leak", | |
"no_index" : { | |
"directory" : [ | |
"t", | |
"inc" | |
] | |
}, | |
"prereqs" : { | |
"build" : { | |
"requires" : { | |
"ExtUtils::MakeMaker" : "0" | |
} | |
}, | |
"configure" : { | |
"requires" : { | |
"ExtUtils::MakeMaker" : "0" | |
} | |
}, | |
"runtime" : { | |
"requires" : {} | |
} | |
}, | |
"release_status" : "stable", | |
"version" : "0.04" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
abstract: unknown | |
author: | |
- unknown | |
build_requires: | |
ExtUtils::MakeMaker: 0 | |
configure_requires: | |
ExtUtils::MakeMaker: 0 | |
dynamic_config: 0 | |
generated_by: 'ExtUtils::MakeMaker version 6.88, CPAN::Meta::Converter version 2.133380' | |
license: unknown | |
meta-spec: | |
url: http://module-build.sourceforge.net/META-spec-v1.4.html | |
version: 1.4 | |
name: Devel-Leak | |
no_index: | |
directory: | |
- t | |
- inc | |
requires: {} | |
version: 0.04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Devel::Leak; | |
use Data::Dumper; | |
use Scalar::Util 'reftype', 'readonly'; | |
use B; | |
use Devel::Peek; | |
sub SvROK () { 0x00000800 } | |
sub SVpav_REIFY () { 0x80000000 } | |
sub SVpav_REAL () { 0x40000000 } | |
sub SVs_PADMY () { 0x00040000 } # /* in use a "my" variable */ | |
sub SVs_TEMP () { 0x00080000 } # /* string is stealable? */ | |
sub SVf_FAKE () { 0x01000000 } # /* 0: glob is just a copy 1: SV head arena wasn't malloc()ed 2: For PVCV, whether CvUNIQUE(cv) refers to an eval or once only [CvEVAL(cv), CvSPECIAL(cv)] 3: On a pad name SV, that slot in the frame AV is a REFCNT'ed reference to a lexical from "outside". */ | |
sub SVf_READONLY { 0x08000000 } # /* may not be modified */ | |
print "loading from: " . $INC{"Devel/Leak.pm"} . "\n"; | |
@somewhere = (); | |
my $count = Devel::Leak::NoteSV($handle); | |
print "$count SVs so far\n"; | |
for my $i (1..10) { | |
@somewhere = qw(one two); | |
} | |
push @somewhere, [ ]; | |
use CGI; | |
my $cgi=CGI->new; | |
my @now = Devel::Leak::CheckSV($handle); | |
print "\nvvvv now vvvv\n"; | |
for my $i ( @now ) { | |
print "got back => ", $i, ' = ', Dumper($i), "\n"; | |
my $sv = B::svref_2object($i); | |
unless( $sv->can('RV') ) { warn "can't RV"; next; } | |
if( $sv->FLAGS & SVf_READONLY ) { warn "READONLY"; next; } | |
if( $sv->FLAGS & SVpav_REIFY ) { warn "can REIFY, yuck"; next; } | |
if( ! $sv->FLAGS & SVpav_REAL ) { warn "not REAL, yuck"; next; } | |
if(reftype($i) eq 'SCALAR' and ! readonly($$i) ) { | |
$$i = undef; | |
} elsif(reftype($i) eq 'HASH'and ! readonly(%$i) ) { | |
eval { %$i = (); }; print $@ if $@; | |
} elsif(reftype($i) eq 'ARRAY' ) { | |
if( ref($sv->ARRAYelt(0)) and ref($sv->ARRAYelt(0)) eq 'B::SPECIAL') { warn "SPECIAL"; next; } | |
if( $sv->ARRAYelt(0)->FLAGS & SVf_READONLY ) { warn "READONLY"; next; } | |
if( ref($sv->ARRAYelt(0)) eq 'B::SPECIAL' ) { warn "SPECIAL (maybe FAKE)"; next; } | |
if( $sv->ARRAYelt(0)->FLAGS & SVs_PADMY ) { warn "PADMY"; next; } | |
if( $sv->ARRAYelt(0)->FLAGS & SVs_TEMP ) { warn "TEMP"; next; } | |
Dump $i; | |
@$i = (); | |
} | |
} | |
print "^^^^ now ^^^^\n"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hash_ptr * T_PTR | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment