@@ -5,24 +5,37 @@ Subject: [PATCH 5/6] Shrink size of static binary search tree
5
5
6
6
This also makes it more efficient on the data cache.
7
7
---
8
- source/lexbor/core/sbst.h | 10 +++++-----
8
+ source/lexbor/core/sbst.h | 19 +++++++++ +++++-----
9
9
source/lexbor/html/tokenizer/state.c | 2 +-
10
10
utils/lexbor/html/tmp/tokenizer_res.h | 2 +-
11
11
utils/lexbor/html/tokenizer_entities_bst.py | 8 ++++----
12
12
utils/lexbor/lexbor/LXB.py | 2 +-
13
- 5 files changed, 12 insertions(+), 12 deletions(-)
13
+ 5 files changed, 21 insertions(+), 12 deletions(-)
14
14
15
15
diff --git a/source/lexbor/core/sbst.h b/source/lexbor/core/sbst.h
16
- index b0fbc54..40e0e91 100644
16
+ index b0fbc54..15a1d40 100644
17
17
--- a/source/lexbor/core/sbst.h
18
18
+++ b/source/lexbor/core/sbst.h
19
- @@ -19,12 +19,12 @@ extern "C" {
19
+ @@ -15,16 +15,25 @@ extern "C" {
20
+
21
+ #include "lexbor/core/base.h"
22
+
23
+ + #ifdef __has_attribute
24
+ + # if __has_attribute(nonstring) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 15
25
+ + # define LXB_NONSTRING __attribute__((nonstring))
26
+ + # else
27
+ + # define LXB_NONSTRING
28
+ + # endif
29
+ + #else
30
+ + # define LXB_NONSTRING
31
+ + #endif
32
+
20
33
typedef struct {
21
34
lxb_char_t key;
22
35
23
36
- void *value;
24
37
- size_t value_len;
25
- + lxb_char_t value[6];
38
+ + lxb_char_t value[6] LXB_NONSTRING ;
26
39
+ unsigned char value_len;
27
40
28
41
- size_t left;
@@ -35,10 +48,10 @@ index b0fbc54..40e0e91 100644
35
48
lexbor_sbst_entry_static_t;
36
49
37
50
diff --git a/source/lexbor/html/tokenizer/state.c b/source/lexbor/html/tokenizer/state.c
38
- index 70ca391..2f3414f 100644
51
+ index 158aade..207b909 100644
39
52
--- a/source/lexbor/html/tokenizer/state.c
40
53
+++ b/source/lexbor/html/tokenizer/state.c
41
- @@ -1815 ,7 +1815 ,7 @@ lxb_html_tokenizer_state_char_ref_named(lxb_html_tokenizer_t *tkz,
54
+ @@ -1820 ,7 +1820 ,7 @@ lxb_html_tokenizer_state_char_ref_named(lxb_html_tokenizer_t *tkz,
42
55
goto done;
43
56
}
44
57
@@ -61,7 +74,7 @@ index b3701d5..73ab66e 100644
61
74
* Do not change this file!
62
75
*/
63
76
diff --git a/utils/lexbor/html/tokenizer_entities_bst.py b/utils/lexbor/html/tokenizer_entities_bst.py
64
- index ee7dcb4..7cd1335 100755
77
+ index 4fa0999..8bd83b2 100755
65
78
--- a/utils/lexbor/html/tokenizer_entities_bst.py
66
79
+++ b/utils/lexbor/html/tokenizer_entities_bst.py
67
80
@@ -1,6 +1,6 @@
@@ -98,7 +111,7 @@ index ee7dcb4..7cd1335 100755
98
111
+ "../../../source/lexbor/html/tokenizer/res.h",
99
112
"data/entities.json");
100
113
diff --git a/utils/lexbor/lexbor/LXB.py b/utils/lexbor/lexbor/LXB.py
101
- index 2370c66..c41e645 100755
114
+ index 3e75812..b068ea3 100755
102
115
--- a/utils/lexbor/lexbor/LXB.py
103
116
+++ b/utils/lexbor/lexbor/LXB.py
104
117
@@ -27,7 +27,7 @@ class Temp:
@@ -111,5 +124,5 @@ index 2370c66..c41e645 100755
111
124
fh.close()
112
125
113
126
- -
114
- 2.44 .0
127
+ 2.49 .0
115
128
0 commit comments