Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: orderly global destruction? blessed references gone? XS ok (sub Main)

by tye (Sage)
on Jul 27, 2011 at 03:27 UTC ( [id://916914]=note: print w/replies, xml ) Need Help??


in reply to orderly global destruction? blessed references gone? XS ok

This is one of the reasons I (still) use my long-standing (and slowly evolving) practice for laying out Perl scripts, outlined in (tye)Re: Stupid question.

In my one module where I have the potential for inner objects, I was able to use the "just check for inner object destroyed early" trick that you mentioned. That is what I would do if possible. If you are just free()ing allocated memory, then that should be enough.

In general, I find it is an excellent idea to avoid XS as much as possible. Doing complex tricks in XS like you discuss above seems to me a pretty bad idea. I see tons of problems (including "core dumps") that appear to be from bugs in even fairly simple XS code in quite main-stream modules that are well maintained.

- tye        

  • Comment on Re: orderly global destruction? blessed references gone? XS ok (sub Main)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://916914]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-19 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found