develooper Front page | perl.perl5.porters | Postings from September 2010

Re: [RFC] Exposing PL_dirty to perl space

Thread Previous | Thread Next
Jesse Vincent
September 27, 2010 22:36
Re: [RFC] Exposing PL_dirty to perl space
Message ID:

On Tue, Sep 28, 2010 at 04:20:31AM +0200, Florian Ragwitz wrote:
> I believe the functionality provided by Devel::GlobalDestruction's
> in_global_destruction() should be in the core.


> I thought about how to expose that, and liked the idea of passing an
> "are we in global destruction?" flag as an extra argument to DESTROY
> best. However, it might break code calling DESTROY explicitly with extra
> arguments as well as code asserting for only one argument in DESTROY,
> like pretty much every DESTROY XSUB in existence.
> The first breakage was beyond anything I would care about, but having to
> update almost all destructors in all XS modules out there seemed like
> something we don't want to do.
> So I implemented a global variable called ${^GLOBAL_DESTRUCTION}
> instead. In addition to what the extra destructor argument would've
> allowed, this also allows checking for global destruction at any point,
> not just directly in destructors. That might be a benefit, but I
> honestly don't care about it all that much - things like Scope::Guard
> could as well just pass down the destruction flag if they want to
> support callees that care about it.
Nice and clean design. I like it.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About