httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe_schae...@yahoo.com>
Subject Re: svn commit: r744281 - /httpd/apreq/trunk/glue/perl/xsbuilder/apreq_xs_postperl.h
Date Sat, 14 Feb 2009 03:26:26 GMT
----- Original Message ----

> From: Fred Moyer <fred@redhotpenguin.com>
> To: apreq-dev@httpd.apache.org
> Sent: Friday, February 13, 2009 6:32:48 PM
> Subject: Re: svn commit: r744281 - /httpd/apreq/trunk/glue/perl/xsbuilder/apreq_xs_postperl.h
> 
> On Fri, Feb 13, 2009 at 3:27 PM,  wrote:
> > Author: joes
> > Date: Fri Feb 13 23:27:31 2009
> > New Revision: 744281
> >
> > URL: http://svn.apache.org/viewvc?rev=744281&view=rev
> > Log:
> > revert, yes mortal is correct here
> 
> Could you give a lamens explanation of sv_2mortal for those of us
> aspiring hackers?  I've seen it all over the place in the mod_perl and
> apreq codebase (and perl as well), but haven't ever been able to track
> down what it really does.

Basically it's the C analog of lexically scoped variables. Mortal SV's
are temporary variables, meant to be freed up by perl at the next 
"convenient" point (usually a FREETMPS call).  If you create an SV in
C, and unless you are constructing parts of an object, you probably want
it to be mortal.  Otherwise you wind up creating an internal perl scalar
that has a refcount that never gets decremented and consequently freed.


      

Mime
View raw message