Commit 6d580e0
committed
Mark strings as IS_STR_VALID_UTF8 on-the-fly
Alternative to GH-10870. Use atomic writes for adding the IS_STR_VALID_UTF8 flag
to UTF-8-verified interned strings in ext-mbstring. x86 and other architectures
guarantee atomic writes/reads for aligned variables up to size_t, which we
already rely on, particularly for zend_op.handler being swapped out in the JIT.
The atomic write is only needed here to not drop any other newly written bits
(which there currently aren't any of). We use GCC and sync atomics because they
don't require annotating the modified variable with the C11 _Atomic keyword.1 parent 779ae6f commit 6d580e0
3 files changed
+30
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
70 | 92 | | |
71 | 93 | | |
72 | 94 | | |
| |||
2263 | 2285 | | |
2264 | 2286 | | |
2265 | 2287 | | |
2266 | | - | |
2267 | | - | |
| 2288 | + | |
| 2289 | + | |
2268 | 2290 | | |
2269 | 2291 | | |
2270 | 2292 | | |
| |||
2273 | 2295 | | |
2274 | 2296 | | |
2275 | 2297 | | |
2276 | | - | |
2277 | | - | |
| 2298 | + | |
| 2299 | + | |
2278 | 2300 | | |
2279 | 2301 | | |
2280 | 2302 | | |
| |||
5567 | 5589 | | |
5568 | 5590 | | |
5569 | 5591 | | |
5570 | | - | |
5571 | | - | |
| 5592 | + | |
| 5593 | + | |
5572 | 5594 | | |
5573 | 5595 | | |
5574 | 5596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
631 | | - | |
| 631 | + | |
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
0 commit comments