diff options
author | Karl Williamson <khw@cpan.org> | 2015-01-12 22:31:07 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-01-13 12:19:59 -0700 |
commit | 2726666d48c2d6d699d0a840da6e9f7a2fdfde22 (patch) | |
tree | 18606efa6f54293d89585b056977a63c44b41ab7 /locale.c | |
parent | c0f3a893f19a236736869b0203e771705a22d986 (diff) | |
download | perl-2726666d48c2d6d699d0a840da6e9f7a2fdfde22.tar.gz |
Move unlikely executed macro to function
The bulk of this macro is extremely rarely executed, so it makes sense
to optimize for space, as it is called from a fair number of places, and
move as much as possible to a single function.
For whatever it's worth, on my system with my typical compilation
options, including -O0, the savings was 19640 bytes in regexec.o, 4528
in utf8.o, at a cost of 1488 in locale.o.
Diffstat (limited to 'locale.c')
-rw-r--r-- | locale.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -414,6 +414,29 @@ Perl_new_ctype(pTHX_ const char *newctype) } void +Perl__warn_problematic_locale() +{ + dTHX; + + /* Outputs the message in PL_warn_locale, and then NULLS it */ + +#ifdef USE_LOCALE_CTYPE + + if (PL_warn_locale) { + /*GCC_DIAG_IGNORE(-Wformat-security); Didn't work */ + Perl_ck_warner(aTHX_ packWARN(WARN_LOCALE), + SvPVX(PL_warn_locale), + 0 /* dummy to avoid compiler warning */ ); + /* GCC_DIAG_RESTORE; */ + SvREFCNT_dec_NN(PL_warn_locale); + PL_warn_locale = NULL; + } + +#endif + +} + +void Perl_new_collate(pTHX_ const char *newcoll) { #ifdef USE_LOCALE_COLLATE |