In perl.git, the branch smoke-me/abolish-PL_formfeed has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/c40e47b00204d44befd4aa764fed59e60e92d5a8?hp=ad0dc73b97f22a660d0022d35f64ccd4ff7bfde6>

- Log -----------------------------------------------------------------
commit c40e47b00204d44befd4aa764fed59e60e92d5a8
Author: Nicholas Clark <n...@ccl4.org>
Date:   Thu Sep 20 10:20:35 2012 +0200

    Eliminate vestigial comment "magical thingies" from intrpvar.h
    
    The original comment "magical thingies" was added to perl.c by commit
    8ebc5c0145d2e355 in Jan 1997. It is above code which frees 4 interpreter-
    global SVs in perl_destruct.
    
    The comment "magical thingies" was in intrpvar.h since the file was created
    by commit 49f531dad558d800 on 29 Nov 1997. At that time, it was followed by
    a block of 13 relevant interpreter global variables. However, by commit
    d4cce5f1785350c2 (30 Nov 1997) all bar two were now in other places, mostly
    in thrdvar.h. With the abolition of PL_formfeed, the comment now annotates
    just one "magical" thingy, PL_basetime, which isn't even one of the SVs
    freed at the analogous location in perl.c. Hence the comment adds no value.

M       intrpvar.h

commit f6dfc73674dee34ba46c58c97d0c3d0bf0bcc5dc
Author: Nicholas Clark <n...@ccl4.org>
Date:   Thu Sep 20 10:00:35 2012 +0200

    Use gv_fetchpvs() instead of gv_fetchpv(), and GV_ADD, not TRUE.
    
    This avoids a needless strlen(), and corrects a classic usage error for the
    gv_fetch*() functions.

M       pp_sys.c

commit cec4dc0e420ef6e3b19b0e6f661d2b4fa43b93fa
Author: Enache Adrian <ena...@rdslink.ro>
Date:   Sat Jul 5 22:08:07 2003 +0300

    Get rid of PL_formfeed.
    
    $^L is neither a magical variable, nor a normal one (like $;) but
    it's just a little bit special :)
    
    This patch removes PL_formfeed - IMHO, an extra gv_fetchpv per page
    when using formats isn't going to cause a sensible speed regression.
    
    I suppose that removing the intrpvar.h hunk from the patch is enough
    to keep binary compatibility - unless someone used PL_formfeed from
    an XS module.
    
    [with regen.pl run as noted by the author, and an additional change to
    perl.c to remove the reference to PL_formfeed added soon after this patch
    was sent]

M       embedvar.h
M       gv.c
M       intrpvar.h
M       perl.c
M       pp_sys.c
M       sv.c

commit 5f7e30c4a6075995b75f8d337d2b381e5463bce3
Author: Nicholas Clark <n...@ccl4.org>
Date:   Wed Sep 19 22:55:37 2012 +0200

    For backcompat, B::formfeed can use gv_fetchpvs() if there is no 
PL_formfeed.

M       ext/B/B.pm
M       ext/B/B.xs
-----------------------------------------------------------------------

Summary of changes:
 embedvar.h |    1 -
 ext/B/B.pm |    2 +-
 ext/B/B.xs |   11 +++++++++++
 gv.c       |    1 -
 intrpvar.h |    3 ---
 perl.c     |    1 -
 pp_sys.c   |    2 +-
 sv.c       |    1 -
 8 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/embedvar.h b/embedvar.h
index b9fabab..92bd2ae 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -174,7 +174,6 @@
 #define PL_filemode            (vTHX->Ifilemode)
 #define PL_firstgv             (vTHX->Ifirstgv)
 #define PL_forkprocess         (vTHX->Iforkprocess)
-#define PL_formfeed            (vTHX->Iformfeed)
 #define PL_formtarget          (vTHX->Iformtarget)
 #define PL_generation          (vTHX->Igeneration)
 #define PL_gensym              (vTHX->Igensym)
diff --git a/ext/B/B.pm b/ext/B/B.pm
index 1274aaa..7229d53 100644
--- a/ext/B/B.pm
+++ b/ext/B/B.pm
@@ -15,7 +15,7 @@ require Exporter;
 # walkoptree comes from B.xs
 
 BEGIN {
-    $B::VERSION = '1.38';
+    $B::VERSION = '1.39';
     @B::EXPORT_OK = ();
 
     # Our BOOT code needs $VERSION set, and will append to @EXPORT_OK.
diff --git a/ext/B/B.xs b/ext/B/B.xs
index ad839b5..435b0cc 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -671,8 +671,10 @@ BOOT:
     ASSIGN_COMMON_ALIAS(I, defstash);
     cv = newXS("B::curstash", intrpvar_sv_common, file);
     ASSIGN_COMMON_ALIAS(I, curstash);
+#ifdef PL_formfeed
     cv = newXS("B::formfeed", intrpvar_sv_common, file);
     ASSIGN_COMMON_ALIAS(I, formfeed);
+#endif
 #ifdef USE_ITHREADS
     cv = newXS("B::regex_padav", intrpvar_sv_common, file);
     ASSIGN_COMMON_ALIAS(I, regex_padav);
@@ -683,6 +685,15 @@ BOOT:
     ASSIGN_COMMON_ALIAS(I, diehook);
 }
 
+#ifndef PL_formfeed
+
+void
+formfeed()
+    PPCODE:
+       PUSHs(make_sv_object(aTHX_ GvSV(gv_fetchpvs("\f", GV_ADD, SVt_PV))));
+
+#endif
+
 long 
 amagic_generation()
     CODE:
diff --git a/gv.c b/gv.c
index abbede6..12f9491 100644
--- a/gv.c
+++ b/gv.c
@@ -1975,7 +1975,6 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN 
full_len, I32 flags,
 
        case '\014':    /* $^L */
            sv_setpvs(GvSVn(gv),"\f");
-           PL_formfeed = GvSV(gv);
            break;
        case ';':               /* $; */
            sv_setpvs(GvSVn(gv),"\034");
diff --git a/intrpvar.h b/intrpvar.h
index 40a6aa1..41d9dbb 100644
--- a/intrpvar.h
+++ b/intrpvar.h
@@ -299,10 +299,7 @@ PERLVAR(I, exit_flags,     U8)             /* was exit() 
unexpected, etc. */
 PERLVAR(I, inplace,    char *)
 PERLVAR(I, e_script,   SV *)
 
-/* magical thingies */
 PERLVAR(I, basetime,   Time_t)         /* $^T */
-PERLVAR(I, formfeed,   SV *)           /* $^L */
-
 
 PERLVARI(I, maxsysfd,  I32,    MAXSYSFD)
                                        /* top fd to pass to subprocesses */
diff --git a/perl.c b/perl.c
index 7d65719..845a70b 100644
--- a/perl.c
+++ b/perl.c
@@ -1229,7 +1229,6 @@ perl_destruct(pTHXx)
        PL_psig_pend = (int*)NULL;
        Safefree(psig_save);
     }
-    PL_formfeed = NULL;
     nuke_stacks();
     PL_tainting = FALSE;
     PL_taint_warn = FALSE;
diff --git a/pp_sys.c b/pp_sys.c
index 65d0bb5..536fb2e 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1453,7 +1453,7 @@ PP(pp_leavewrite)
            }
        }
        if (IoLINES_LEFT(io) >= 0 && IoPAGE(io) > 0)
-           do_print(PL_formfeed, ofp);
+           do_print(GvSV(gv_fetchpvs("\f", GV_ADD, SVt_PV)), ofp);
        IoLINES_LEFT(io) = IoPAGE_LEN(io);
        IoPAGE(io)++;
        PL_formtarget = PL_toptarget;
diff --git a/sv.c b/sv.c
index 89699be..1d42afb 100644
--- a/sv.c
+++ b/sv.c
@@ -13161,7 +13161,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     PL_e_script                = sv_dup_inc(proto_perl->Ie_script, param);
 
     /* magical thingies */
-    PL_formfeed                = sv_dup(proto_perl->Iformfeed, param);
 
     PL_encoding                = sv_dup(proto_perl->Iencoding, param);
 

--
Perl5 Master Repository

Reply via email to