Move initialising PL_osname from S_init_predump_symbols to perl_construct().
Nicholas Clark [Mon, 5 Oct 2009 18:20:49 +0000 (20:20 +0200)]
perl.c

diff --git a/perl.c b/perl.c
index be11625..a15f86e 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -391,6 +391,8 @@ perl_construct(pTHXx)
     PL_timesbase.tms_cstime = 0;
 #endif
 
+    PL_osname = Perl_savepvn(aTHX_ STR_WITH_LEN(OSNAME));
+
     PL_registered_mros = newHV();
     /* Start with 1 bucket, for DFS.  It's unlikely we'll need more.  */
     HvMAX(PL_registered_mros) = 0;
@@ -3884,9 +3886,6 @@ S_init_predump_symbols(pTHX)
     GvIOp(tmpgv) = MUTABLE_IO(SvREFCNT_inc_simple(io));
 
     PL_statname = newSV(0);            /* last filename we did stat on */
-
-    Safefree(PL_osname);
-    PL_osname = savepv(OSNAME);
 }
 
 void