ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/bin/aemp
(Generate patch)

Comparing AnyEvent-MP/bin/aemp (file contents):
Revision 1.20 by root, Sun Aug 30 13:22:46 2009 UTC vs.
Revision 1.21 by root, Sun Aug 30 13:27:22 2009 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2
3
4# very stupid leak checker, checks after some time whether the passed
5# object is still around and tracks it via Devel::FindRef.
6sub leakcheck($$) {#d#
7 my ($after, $ref) = @_;
8
9use EV;#d#
10 Scalar::Util::weaken $ref;
11
12 my $w; $w = EV::timer $after, 0, sub {
13 undef $w;
14 return unless $ref;
15
16 require Devel::FindRef;
17 warn "object $ref still alive after $after seconds:\n"
18 . Devel::FindRef::track ($ref, 30);
19 };
20}
21 2
22=head1 NAME 3=head1 NAME
23 4
24 aemp - AnyEvent:MP utility 5 aemp - AnyEvent:MP utility
25 6

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines