Skip to content

Commit

Permalink
XXX Partial need vutil.c first Rmv underlying numeric
Browse files Browse the repository at this point in the history
This object, only on POSIX 2008 systems, is no longer used.  I've been
keeping it around in case I could figure out if it had any remaining
utility, but don't see any.
  • Loading branch information
khwilliamson committed May 6, 2023
1 parent de78e8c commit fd9b7b6
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 46 deletions.
1 change: 0 additions & 1 deletion embedvar.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions intrpvar.h
Expand Up @@ -853,11 +853,6 @@ PERLVAR(I, numeric_name, char *) /* Name of current numeric locale */
PERLVAR(I, numeric_radix_sv, SV *) /* The radix separator */
PERLVAR(I, underlying_radix_sv, SV *) /* The radix in the program's current underlying locale */

#if defined(USE_LOCALE_NUMERIC) && defined(USE_POSIX_2008_LOCALE)

PERLVARI(I, underlying_numeric_obj, locale_t, NULL)

#endif
#ifdef USE_POSIX_2008_LOCALE
PERLVARI(I, scratch_locale_obj, locale_t, 0)
#endif
Expand Down
20 changes: 0 additions & 20 deletions locale.c
Expand Up @@ -2915,9 +2915,6 @@ S_new_numeric(pTHX_ const char *newnum, bool force)
* character string. This is copied into
* PL_numeric_radix_sv when the situation warrants. It
* exists to avoid having to recalculate it when toggling.
* PL_underlying_numeric_obj = (only on POSIX 2008 platforms) An object
* with everything set up properly so as to avoid work on
* such platforms.
*/

DEBUG_L( PerlIO_printf(Perl_debug_log,
Expand Down Expand Up @@ -2950,20 +2947,6 @@ S_new_numeric(pTHX_ const char *newnum, bool force)
* function */
PL_numeric_underlying = TRUE;

# ifdef USE_POSIX_2008_LOCALE

/* We keep a special object for easy switching to.
*
* NOTE: This code may incorrectly show up as a leak under the address
* sanitizer. We do not free this object under normal teardown, however
* you can set PERL_DESTRUCT_LEVEL=2 to cause it to be freed.
*/
PL_underlying_numeric_obj = newlocale(LC_NUMERIC_MASK,
PL_numeric_name,
PL_underlying_numeric_obj);

# endif

const char * radix = NULL;
utf8ness_t utf8ness = UTF8NESS_IMMATERIAL;

Expand Down Expand Up @@ -6500,11 +6483,8 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
* malloc'd in the interim */
uselocale(PL_C_locale_obj);

# ifdef USE_LOCALE_NUMERIC

PL_underlying_numeric_obj = duplocale(PL_C_locale_obj);

# endif
# endif
# ifdef USE_LOCALE_NUMERIC

Expand Down
8 changes: 0 additions & 8 deletions makedef.pl
Expand Up @@ -462,7 +462,6 @@ sub readvar {
++$skip{$_} foreach qw(
PL_C_locale_obj
PL_scratch_locale_obj
PL_underlying_numeric_obj
);
}
unless ($define{USE_PL_CURLOCALES})
Expand Down Expand Up @@ -613,13 +612,6 @@ sub readvar {
);
}


unless ($define{USE_LOCALE_NUMERIC}) {
++$skip{$_} foreach qw(
PL_underlying_numeric_obj
);
}

unless ($define{USE_LOCALE_CTYPE}) {
++$skip{$_} foreach qw(
PL_ctype_name
Expand Down
9 changes: 0 additions & 9 deletions perl.c
Expand Up @@ -1160,15 +1160,6 @@ perl_destruct(pTHXx)
freelocale(PL_scratch_locale_obj);
PL_scratch_locale_obj = NULL;
}
# ifdef USE_LOCALE_NUMERIC
if (PL_underlying_numeric_obj) {
DEBUG_Lv(PerlIO_printf(Perl_debug_log,
"%s:%d: Freeing %p\n", __FILE__, __LINE__,
PL_underlying_numeric_obj));
freelocale(PL_underlying_numeric_obj);
PL_underlying_numeric_obj = (locale_t) NULL;
}
# endif
#endif
#ifdef USE_LOCALE_NUMERIC
Safefree(PL_numeric_name);
Expand Down
3 changes: 0 additions & 3 deletions sv.c
Expand Up @@ -16080,9 +16080,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_numeric_underlying = true;
PL_numeric_underlying_is_standard = true;

# if defined(USE_POSIX_2008_LOCALE)
PL_underlying_numeric_obj = NULL;
# endif
#endif /* !USE_LOCALE_NUMERIC */
#if defined(USE_POSIX_2008_LOCALE)
PL_scratch_locale_obj = NULL;
Expand Down

0 comments on commit fd9b7b6

Please sign in to comment.