Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: perlembed: mortalize an AV, get "Attempt to free unreferenced scalar" - don't mortalize, leaks memory

by demerphq (Chancellor)
on Jul 11, 2006 at 09:57 UTC ( #560379=note: print w/ replies, xml ) Need Help??


in reply to Re^4: perlembed: mortalize an AV, get "Attempt to free unreferenced scalar" - don't mortalize, leaks memory
in thread perlembed: mortalize an AV, get "Attempt to free unreferenced scalar" - don't mortalize, leaks memory

nor does it free the SVs that form its elements

moron is partially correct, it does free the SV's that form its elements. Although indirectly via refcount decrement. Thats what the follow code does:

while (index) { SV * const sv = ary[--index]; /* undef the slot before freeing the value, because a * destructor might try to modify this array */ ary[index] = &PL_sv_undef; SvREFCNT_dec(sv); }
---
$world=~s/war/peace/g


Comment on Re^5: perlembed: mortalize an AV, get "Attempt to free unreferenced scalar" - don't mortalize, leaks memory
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-08-21 04:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls