This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
dump.c: dump physical, not logical, AVs
[perl5.git] / perl.c
diff --git a/perl.c b/perl.c
index 98bfdcf..44f8642 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -420,6 +420,9 @@ perl_construct(pTHXx)
     PL_SB_invlist = _new_invlist_C_array(_Perl_SB_invlist);
     PL_WB_invlist = _new_invlist_C_array(_Perl_WB_invlist);
     PL_LB_invlist = _new_invlist_C_array(_Perl_LB_invlist);
+#ifdef USE_THREAD_SAFE_LOCALE
+    PL_C_locale_obj = newlocale(LC_ALL_MASK, "C", NULL);
+#endif
 
     ENTER;
 }
@@ -1124,6 +1127,16 @@ perl_destruct(pTHXx)
     PL_SB_invlist = NULL;
     PL_WB_invlist = NULL;
 
+#ifdef USE_THREAD_SAFE_LOCALE
+    if (PL_C_locale_obj) {
+        /* Make sure we aren't using the locale space we are about to free */
+        uselocale(LC_GLOBAL_LOCALE);
+
+        freelocale(PL_C_locale_obj);
+        PL_C_locale_obj = (locale_t) NULL;
+    }
+#endif
+
     if (!specialWARN(PL_compiling.cop_warnings))
        PerlMemShared_free(PL_compiling.cop_warnings);
     PL_compiling.cop_warnings = NULL;
@@ -2835,7 +2848,7 @@ Perl_call_sv(pTHX_ SV *sv, VOL I32 flags)
        (void)POPMARK;
         old_cxix = cxstack_ix;
        create_eval_scope(NULL, flags|G_FAKINGEVAL);
-       (void)INCMARK;
+       INCMARK;
 
        JMPENV_PUSH(ret);