Skip to content

Commit 15ab8ca

Browse files
committed
reduce data cache pressure.
1 parent 42abbcb commit 15ab8ca

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

include/fast_float/ascii_number.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,16 @@ enum class parse_error : uint_fast8_t {
473473
};
474474

475475
template <typename UC> struct parsed_number_string_t {
476+
FASTFLOAT_NO_UNIQUE_ADDRESS UC const *lastmatch;
476477
FASTFLOAT_NO_UNIQUE_ADDRESS am_mant_t mantissa;
477478
FASTFLOAT_NO_UNIQUE_ADDRESS am_pow_t exponent;
478-
FASTFLOAT_NO_UNIQUE_ADDRESS UC const *lastmatch;
479+
480+
FASTFLOAT_NO_UNIQUE_ADDRESS parse_error error;
479481
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
480482
FASTFLOAT_NO_UNIQUE_ADDRESS bool negative;
481483
#endif
482484
FASTFLOAT_NO_UNIQUE_ADDRESS bool invalid;
483485
FASTFLOAT_NO_UNIQUE_ADDRESS bool too_many_digits;
484-
FASTFLOAT_NO_UNIQUE_ADDRESS parse_error error;
485486

486487
// contains the range of the significant digits
487488
FASTFLOAT_NO_UNIQUE_ADDRESS span<UC const> integer; // non-nullable

include/fast_float/float_common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ enum class chars_format : chars_format_t {
8989
};
9090

9191
template <typename UC> struct from_chars_result_t {
92-
UC const *ptr;
93-
std::errc ec;
92+
FASTFLOAT_NO_UNIQUE_ADDRESS UC const *ptr;
93+
FASTFLOAT_NO_UNIQUE_ADDRESS std::errc ec;
9494

9595
// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2497r0.html
9696
constexpr explicit operator bool() const noexcept {
@@ -495,8 +495,8 @@ fastfloat_strncasecmp(UC const *actual_mixedcase, UC const *expected_lowercase,
495495

496496
// a pointer and a length to a contiguous block of memory
497497
template <typename T> struct span {
498-
T const *ptr;
499-
am_digits length;
498+
FASTFLOAT_NO_UNIQUE_ADDRESS T const *ptr;
499+
FASTFLOAT_NO_UNIQUE_ADDRESS am_digits length;
500500

501501
constexpr span(T const *_ptr, am_digits _length) noexcept
502502
: ptr(_ptr), length(_length) {}

0 commit comments

Comments
 (0)