Changeset c6adf17 for perlglue.xs


Ignore:
Timestamp:
Oct 1, 2010, 9:22:20 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
afaef6e
Parents:
385cce2
git-author:
David Benjamin <davidben@mit.edu> (09/25/10 02:02:45)
git-committer:
David Benjamin <davidben@mit.edu> (10/01/10 21:22:20)
Message:
Track names along with timers, add :show timers

This will help people with BarnOwls eating CPU to diagnose timer leaks.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlglue.xs

    r818f19c rc6adf17  
    516516
    517517IV
    518 add_timer(after, interval, cb)
     518add_timer(after, interval, cb, name = NULL)
    519519        int after
    520520        int interval
    521521        SV *cb
     522        const char *name
    522523        PREINIT:
    523524                SV *ref;
     
    525526        CODE:
    526527                ref = sv_rvweaken(newSVsv(cb));
    527                 t = owl_select_add_timer(after,
     528                t = owl_select_add_timer(name,
     529                                         after,
    528530                                         interval,
    529531                                         owl_perlconfig_perl_timer,
    530532                                         owl_perlconfig_perl_timer_destroy,
    531533                                         ref);
    532         owl_function_debugmsg("Created timer %p", t);
     534                owl_function_debugmsg("Created timer %s: %p", t->name ? t->name : "(unnamed)", t);
    533535        RETVAL = (IV)t;
    534536        OUTPUT:
     
    542544        CODE:
    543545                t = (owl_timer*)timer;
    544                 owl_function_debugmsg("Freeing timer %p", t);
    545                                 owl_select_remove_timer(t);
     546                owl_function_debugmsg("Freeing timer %s: %p", t->name ? t->name : "(unnamed)", t);
     547                owl_select_remove_timer(t);
    546548
    547549MODULE = BarnOwl                PACKAGE = BarnOwl::Editwin
Note: See TracChangeset for help on using the changeset viewer.