GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DEVEL::EVENTS::HANDLER::OBJECTTRACKER (3)

.ds Aq ’

NAME

Devel::Events::Handler::ObjectTracker - A Devel::Events that tracks leaks

CONTENTS

SYNOPSIS



        use Devel::Events::Handler::ObjectTracker;
        use Devel::Events::Generator::Objects;

        my $tracker = Devel::Events::Handler::ObjectTracker->new();

        my $gen = Devel::Events::Generator::Objects->new(
                handler => $tracker,
        );

        $gen->enable(); # start generating events

        $code->();

        $gen->disable();

        use Data::Dumper;
        warn Dumper($tracker->live_objects);



DESCRIPTION

This object will keep track of every object created and every object destroyed based on the object_bless and object_destroy events. Reblessing is accounted for.

This handler doesn’t perform any magical stuff, Devel::Events::Generator::Objects is responsible for raising the proper events.

ATTRIBUTES

live_objects A Tie::RefHash::Weak hash that keeps an index of every live object and the object_bless event that created it.
class_counters Keeps a count of the live instances per class, much like Devel::Leak::Object.
object_to_class USed to maintain the class_counters hash.

METHODS

new_event @event Delegates to handle_object_bless or handle_object_destroy
handle_object_bless @event Adds an entry in the live_objects table.
event_to_entry @event Munges event data into an entry for the live_objects table.
handle_object_destroy Decrements the class_counters counter.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DEVEL::EVENTS::HANDLER::OBJECTTRACKER (3) 2008-06-21

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.