From b2779ad9f7324042fd14b4f2edb7e96e4beb35e8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 8 Apr 2025 20:53:34 +0200 Subject: [PATCH] AK: Shrink Utf16View from 40 bytes to 32 bytes This ends up making RegexStringView smaller, which means less stuff to copy when forking in the regex engine. Thanks to Leon for suggesting the [[no_unique_address]] trick! --- AK/Utf16View.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/Utf16View.h b/AK/Utf16View.h index 19ae89c5ff3..b26d4faf1be 100644 --- a/AK/Utf16View.h +++ b/AK/Utf16View.h @@ -138,7 +138,7 @@ private: size_t calculate_length_in_code_points() const; ReadonlySpan m_code_units; - mutable Optional m_length_in_code_points; + [[no_unique_address]] mutable Optional m_length_in_code_points; Endianness m_endianness { Endianness::Host }; };