Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: Attempt to free unreferenced scalar

by tqisjim (Beadle)
on Mar 20, 2013 at 15:12 UTC ( [id://1024535]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Attempt to free unreferenced scalar
in thread Attempt to free unreferenced scalar

Thanks again for the helpful response.

My understanding is that Perl will not try to free() a weak reference. But I seem to recall reading that a weak reference is copied as a strong reference. If true, that might explain everything, since the copy will trigger free() on memory already unallocated.

I'm probably out of my league, but I assume that a weak reference copy should also be weak. Is this behavior limited to 5.10 and 5.12? Certainly a neat and tidy explanation and a manageable workaround. You're probably the best resource for sanity checking that theory. And then, is it possible to confirm by rooting around the change logs?

It's always a exciting... and a little scary... to get so close to the internals ;)

  • Comment on Re^4: Attempt to free unreferenced scalar

Replies are listed 'Best First'.
Re^5: Attempt to free unreferenced scalar
by ikegami (Patriarch) on Mar 24, 2013 at 07:22 UTC

    Weak refs just cause scalars to get undefined.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found