Commit 35aabc8
committed
Route codepoint helpers through the capsule API
Per follow-up review on #21522, the codepoint classifiers belong with
the rest of the librt.strings public surface rather than in a shared
inline header, since they implement Python-visible librt.strings
functions (not mypyc-internal codegen helpers like the other _extra_ops
files). Move them out of codepoint_extra_ops.h and into librt_strings.c
as proper non-static functions, exposed to mypyc-compiled callers via
the capsule API the same way every other LibRTStrings_* function works.
This keeps the librt module files independent of mypyc-internal
_extra_ops headers, matching the pattern used by BytesWriter_internal
etc. The cost is one indirect call per use vs. the previous inlined
macro; still substantially faster than the Python method dispatch the
primitives are replacing.
- librt_strings.h: bump LIBRT_STRINGS_API_VERSION 4->5, LIBRT_STRINGS_API_LEN
14->19.
- librt_strings_api.h: add 5 macro entries for LibRTStrings_API[14..18].
- librt_strings.c: define the 5 helpers; register them in the capsule
table; drop `#include "codepoint_extra_ops.h"`.
- mypyc/ir/deps.py: delete CODEPOINT_EXTRA_OPS.
- mypyc/primitives/librt_strings_ops.py: drop the CODEPOINT_EXTRA_OPS
dep from the five codepoint primitives.
- Delete codepoint_extra_ops.{c,h}.1 parent 472aab0 commit 35aabc8
7 files changed
Lines changed: 64 additions & 82 deletions
File tree
- mypyc
- ir
- lib-rt
- strings
- primitives
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | 119 | | |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
1154 | 1153 | | |
1155 | 1154 | | |
1156 | 1155 | | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
1166 | 1200 | | |
1167 | 1201 | | |
1168 | 1202 | | |
| |||
1317 | 1351 | | |
1318 | 1352 | | |
1319 | 1353 | | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
1320 | 1359 | | |
1321 | 1360 | | |
1322 | 1361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 1 | + | |
7 | 2 | | |
8 | 3 | | |
9 | 4 | | |
| |||
402 | 397 | | |
403 | 398 | | |
404 | 399 | | |
405 | | - | |
| 400 | + | |
406 | 401 | | |
407 | 402 | | |
408 | 403 | | |
| |||
411 | 406 | | |
412 | 407 | | |
413 | 408 | | |
414 | | - | |
| 409 | + | |
415 | 410 | | |
416 | 411 | | |
417 | 412 | | |
| |||
420 | 415 | | |
421 | 416 | | |
422 | 417 | | |
423 | | - | |
| 418 | + | |
424 | 419 | | |
425 | 420 | | |
426 | 421 | | |
| |||
429 | 424 | | |
430 | 425 | | |
431 | 426 | | |
432 | | - | |
| 427 | + | |
433 | 428 | | |
434 | 429 | | |
435 | 430 | | |
436 | 431 | | |
437 | | - | |
| 432 | + | |
438 | 433 | | |
439 | 434 | | |
440 | 435 | | |
441 | 436 | | |
442 | 437 | | |
443 | 438 | | |
444 | | - | |
| 439 | + | |
445 | 440 | | |
0 commit comments