develooper Front page | perl.perl5.porters | Postings from July 2003

[PATCH] getting rid of PL_formfeed ?

Thread Next
From:
Enache Adrian
Date:
July 5, 2003 12:03
Subject:
[PATCH] getting rid of PL_formfeed ?
Message ID:
20030705190807.GA20108@ratsnest.hole
$^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.

[ make clean && perl embed.pl needed if trying this patch ]

Regards,
Adi

--- /arc/bleadperl/gv.c	2003-06-16 01:19:47.000000000 +0300
+++ ./gv.c	2003-07-05 21:12:58.000000000 +0300
@@ -1035,7 +1035,6 @@
 	if (len > 1)
 	    break;
 	sv_setpv(GvSV(gv),"\f");
-	PL_formfeed = GvSV(gv);
 	break;
     case ';':
 	if (len > 1)
--- /arc/bleadperl/intrpvar.h	2003-06-26 09:48:12.000000000 +0300
+++ ./intrpvar.h	2003-07-05 21:26:24.000000000 +0300
@@ -64,8 +64,6 @@
 
 /* magical thingies */
 PERLVAR(Ibasetime,	Time_t)		/* $^T */
-PERLVAR(Iformfeed,	SV *)		/* $^L */
-
 
 PERLVARI(Imaxsysfd,	I32,	MAXSYSFD)
 					/* top fd to pass to subprocesses */
--- /arc/bleadperl/pp_sys.c	2003-07-01 15:34:09.000000000 +0300
+++ ./pp_sys.c	2003-07-05 21:24:22.000000000 +0300
@@ -1347,7 +1347,7 @@
 	    }
 	}
 	if (IoLINES_LEFT(io) >= 0 && IoPAGE(io) > 0)
-	    do_print(PL_formfeed, ofp);
+	    do_print(GvSV(gv_fetchpv("\f", TRUE, SVt_PV)), ofp);
 	IoLINES_LEFT(io) = IoPAGE_LEN(io);
 	IoPAGE(io)++;
 	PL_formtarget = PL_toptarget;
--- /arc/bleadperl/sv.c	2003-07-03 23:09:38.000000000 +0300
+++ ./sv.c	2003-07-05 21:21:18.000000000 +0300
@@ -10969,7 +10969,6 @@
     /* magical thingies */
     /* XXX time(&PL_basetime) when asked for? */
     PL_basetime		= proto_perl->Ibasetime;
-    PL_formfeed		= sv_dup(proto_perl->Iformfeed, param);
 
     PL_maxsysfd		= proto_perl->Imaxsysfd;
     PL_multiline	= proto_perl->Imultiline;

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