determined by C<strlen()>, which means it may not contain embedded C<NUL>
characters and must have a trailing C<NUL>. To prevent memory leaks, the
memory allocated for the new string needs to be freed when no longer needed.
-This can be done with the L</C<Safefree> function, or
-L<C<SAFEFREEPV>perlguts/SAFEFREEPV>.
+This can be done with the L</C<Safefree>> function, or
+L<C<SAVEFREEPV>|perlguts/SAVEFREEPV(p)>.
On some platforms, Windows for example, all allocated memory owned by a thread
is deallocated when that thread ends. So if you need that not to happen, you
Perl_init_tm(pTHX_ struct tm *ptm) /* see mktime, strftime and asctime */
{
#ifdef HAS_TM_TM_ZONE
+ dVAR;
Time_t now;
const struct tm* my_tm;
PERL_UNUSED_CONTEXT;
PERL_ARGS_ASSERT_INIT_TM;
(void)time(&now);
+ ENV_LOCALE_READ_LOCK;
my_tm = localtime(&now);
if (my_tm)
Copy(my_tm, ptm, 1, struct tm);
+ ENV_LOCALE_READ_UNLOCK;
#else
PERL_UNUSED_CONTEXT;
PERL_ARGS_ASSERT_INIT_TM;