diff --git a/ext/lexbor/lexbor/core/sbst.h b/ext/lexbor/lexbor/core/sbst.h index 40e0e9148a7..03444afdc74 100644 --- a/ext/lexbor/lexbor/core/sbst.h +++ b/ext/lexbor/lexbor/core/sbst.h @@ -15,11 +15,21 @@ extern "C" { #include "lexbor/core/base.h" +#ifdef __has_attribute +# if __has_attribute(nonstring) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 15 +# define LXB_NONSTRING __attribute__((nonstring)) +# else +# define LXB_NONSTRING +# endif +#else +# define LXB_NONSTRING +#endif + typedef struct { lxb_char_t key; - lxb_char_t value[6]; + lxb_char_t value[6] LXB_NONSTRING; unsigned char value_len; unsigned short left; diff --git a/ext/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch b/ext/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch index 6c96ce73a3d..bf2acce1a84 100644 --- a/ext/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch +++ b/ext/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch @@ -5,24 +5,37 @@ Subject: [PATCH 5/6] Shrink size of static binary search tree This also makes it more efficient on the data cache. --- - source/lexbor/core/sbst.h | 10 +++++----- + source/lexbor/core/sbst.h | 19 ++++++++++++++----- source/lexbor/html/tokenizer/state.c | 2 +- utils/lexbor/html/tmp/tokenizer_res.h | 2 +- utils/lexbor/html/tokenizer_entities_bst.py | 10 +++++----- utils/lexbor/lexbor/LXB.py | 2 +- - 5 files changed, 13 insertions(+), 13 deletions(-) + 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/source/lexbor/core/sbst.h b/source/lexbor/core/sbst.h -index b0fbc54..40e0e91 100644 +index b0fbc54..15a1d40 100644 --- a/source/lexbor/core/sbst.h +++ b/source/lexbor/core/sbst.h -@@ -19,12 +19,12 @@ extern "C" { +@@ -15,16 +15,25 @@ extern "C" { + + #include "lexbor/core/base.h" + ++#ifdef __has_attribute ++# if __has_attribute(nonstring) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 15 ++# define LXB_NONSTRING __attribute__((nonstring)) ++# else ++# define LXB_NONSTRING ++# endif ++#else ++# define LXB_NONSTRING ++#endif + typedef struct { lxb_char_t key; - void *value; - size_t value_len; -+ lxb_char_t value[6]; ++ lxb_char_t value[6] LXB_NONSTRING; + unsigned char value_len; - size_t left; @@ -61,7 +74,7 @@ index b3701d5..73ab66e 100644 * Do not change this file! */ diff --git a/utils/lexbor/html/tokenizer_entities_bst.py b/utils/lexbor/html/tokenizer_entities_bst.py -index 4fa0999..7cd1335 100755 +index 4fa0999..8bd83b2 100755 --- a/utils/lexbor/html/tokenizer_entities_bst.py +++ b/utils/lexbor/html/tokenizer_entities_bst.py @@ -1,6 +1,6 @@ @@ -107,7 +120,7 @@ index 4fa0999..7cd1335 100755 + "../../../source/lexbor/html/tokenizer/res.h", "data/entities.json"); diff --git a/utils/lexbor/lexbor/LXB.py b/utils/lexbor/lexbor/LXB.py -index 2370c66..c41e645 100755 +index 3e75812..b068ea3 100755 --- a/utils/lexbor/lexbor/LXB.py +++ b/utils/lexbor/lexbor/LXB.py @@ -27,7 +27,7 @@ class Temp: