Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^4: Attempt to free unreferenced scalar

by tqisjim (Beadle)
on Mar 20, 2013 at 15:12 UTC ( #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 (Pope) on Mar 24, 2013 at 07:22 UTC

    Weak refs just cause scalars to get undefined.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024535]
[erix]: yeah, I ask for the text (I don't see signatures)
[Discipulus]: dear brother karl has "Furthermore I consider that Donald Trump must be impeached as soon as possible" in his sig
[erix]: ah, thanks Discipulus
[1nickt]: erix perhaps you could kindly point out your technique to roho and everyone will be happy.
[Discipulus]: but i'm also animalist, so i' hirted by 1nickt's sig: The way forward always starts with a mammal test... grin..
[erix]: I might if I did remember. It's probably somewhere in the site docs
[uhClem]: I don't favor that sort of thing around here but the place for our politics is wherever we live.
[uhClem]: And besides, the objection to it was off-topic.
[Discipulus]: 1nickt hide signature is a positive action; i think is not a solution here

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2017-06-22 12:33 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (519 votes). Check out past polls.