develooper Front page | perl.perl5.porters | Postings from May 2015

[perl #122368] [PATCH] improve docs about mortal in perlguts

Tony Cook via RT
May 27, 2015 07:03
[perl #122368] [PATCH] improve docs about mortal in perlguts
Message ID:
On Tue Apr 28 12:35:10 2015, bulk88 wrote:
 "Mortalization" then is at its simplest a deferred C<SvREFCNT_dec>.
 However, if you mortalize a variable twice, the reference count will
-later be decremented twice.
+later be decremented twice.  Mortalization can be thought of attaching an SV to
+the current scope, or current executing statement of Perl code, and upon the
+change to the next Perl language scope (C<}>), or next Perl language statement
+(C<;>), or XS synthesis of those 2 Perl langauge concepts, the SV will be
+freed if nothing else wanted to retain the SV.  Mortal is similar to a C++
+smart pointer.

It might be better to just say that FREETMPS is called in those places.


via perlbug:  queue: perl5 status: open Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About