develooper Front page | perl.perl5.porters | Postings from December 2013

Re: An article on writing Perl extensions without XS

Thread Previous | Thread Next
From:
bulk88
Date:
December 18, 2013 15:40
Subject:
Re: An article on writing Perl extensions without XS
Message ID:
BLU0-SMTP85444E624A9B4BE8A687DFDFDA0@phx.gbl
Steffen Mueller wrote:
> On 12/17/2013 02:51 PM, Christian Walde wrote:
>> After explaining in #p5p that outputs need to replace the inputs on the
>> stack, this all makes a lot more sense.
>>
>> Steffen, you probably want to mention this fact early on in your article
>> so the rest is more self-explanatory. :)
> 
> I updated the article to mention this.
> 
> --Steffen
> 

I would change

"At the end of each executed statement, the mortal stack is cleaned up 
and the reference count of each item on the stack is decremented, 
possibly causing the item to be freed[4]. Thus the name: items on the 
stack are mortal, soon to pass away."

to

"At the end of each executed statement, the mortal stack is cleaned up 
and the reference count of each item on the stack is decremented. If the 
caller does not take steps to save the SV from being freed, it will 
probably be freed[4]. Thus the name: items on the stack are mortal, soon 
to pass away."

To explain that the caller, if it wants can keep around the SV. There is 
no guarantee they will be freed when the xsub returns, if all the SVs 
refcnt is 1.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About