diff --git a/include/nlohmann/detail/input/binary_reader.hpp b/include/nlohmann/detail/input/binary_reader.hpp index f1847e62e..b2a6b7e79 100644 --- a/include/nlohmann/detail/input/binary_reader.hpp +++ b/include/nlohmann/detail/input/binary_reader.hpp @@ -1148,10 +1148,8 @@ class binary_reader } } - /// read a single- or double-precision float (kept out of - /// parse_cbor_value, which is inlined into parse_cbor_internal) + /// read a single- or double-precision float template - JSON_HEDLEY_NEVER_INLINE bool get_cbor_float() { NumberType number{}; @@ -4474,7 +4472,12 @@ class binary_reader `char_traits::eof()` in that case. @return character read from the input + + @note always inlined: GCC otherwise stops inlining the stream adapter's + get_character() into parse_cbor_internal once that function grows + (+0.45 % instructions for CBOR from a std::istringstream with GCC 13) */ + JSON_HEDLEY_ALWAYS_INLINE char_int_type get() { ++chars_read; diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index ed3a28bd9..84fc74088 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -18925,10 +18925,8 @@ class binary_reader } } - /// read a single- or double-precision float (kept out of - /// parse_cbor_value, which is inlined into parse_cbor_internal) + /// read a single- or double-precision float template - JSON_HEDLEY_NEVER_INLINE bool get_cbor_float() { NumberType number{}; @@ -22251,7 +22249,12 @@ class binary_reader `char_traits::eof()` in that case. @return character read from the input + + @note always inlined: GCC otherwise stops inlining the stream adapter's + get_character() into parse_cbor_internal once that function grows + (+0.45 % instructions for CBOR from a std::istringstream with GCC 13) */ + JSON_HEDLEY_ALWAYS_INLINE char_int_type get() { ++chars_read;