Improve binary size

This commit is contained in:
Victor Zverovich 2024-08-29 19:12:55 -07:00
parent 6dd9194abd
commit 2a2f73f7c1
2 changed files with 7 additions and 7 deletions

View File

@ -227,7 +227,7 @@
# define FMT_NO_UNIQUE_ADDRESS
#endif
#ifdef FMT_INLINE
#ifdef FMT_ALWAYS_INLINE
// Use the provided definition.
#elif FMT_GCC_VERSION || FMT_CLANG_VERSION
# define FMT_ALWAYS_INLINE inline __attribute__((always_inline))
@ -1657,6 +1657,10 @@ struct is_output_iterator<
void_t<decltype(*std::declval<decay_t<It>&>()++ = std::declval<T>())>>
: std::true_type {};
#ifndef FMT_OPTIMIZE_SIZE
# define FMT_OPTIMIZE_SIZE 0
#endif
#ifdef FMT_USE_LOCALE
// Use the provided definition.
#elif defined(FMT_STATIC_THOUSANDS_SEPARATOR)
@ -2779,7 +2783,7 @@ FMT_CONSTEXPR void parse_format_string(basic_string_view<Char> format_str,
Handler&& handler) {
auto begin = format_str.data();
auto end = begin + format_str.size();
if (end - begin < 32) {
if (FMT_OPTIMIZE_SIZE || end - begin < 32) {
// Use a simple loop instead of memchr for small strings.
const Char* p = begin;
while (p != end) {

View File

@ -1166,10 +1166,6 @@ FMT_CONSTEXPR inline auto count_digits(uint128_opt n) -> int {
}
#endif
#ifndef FMT_OPTIMIZE_SIZE
# define FMT_OPTIMIZE_SIZE 0
#endif
#ifdef FMT_BUILTIN_CLZLL
// It is a separate function rather than a part of count_digits to workaround
// the lack of static constexpr in constexpr functions.
@ -3677,7 +3673,7 @@ template <typename Char> struct default_arg_formatter {
template <typename Char> struct arg_formatter {
basic_appender<Char> out;
const format_specs& specs;
locale_ref locale;
FMT_NO_UNIQUE_ADDRESS locale_ref locale;
template <typename T, FMT_ENABLE_IF(is_builtin<T>::value)>
FMT_CONSTEXPR FMT_INLINE void operator()(T value) {