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
Devel::Events::Handler::ObjectTracker(3) User Contributed Perl Documentation Devel::Events::Handler::ObjectTracker(3)

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

        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);

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.

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.

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.
2008-06-21 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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