Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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?
[Discipulus]: ah no newest nodes! ask something
[beech]: why is my butt itchy
Discipulus many countries without bidet.. is a big problem!
[beech]: who told you i call my butt france?
Discipulus ??
beech waves a white flag -- no detectible causes of itch

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2016-12-09 09:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.