Commit 1b17640
committed
gh-115184: Fix refleak tracking issues in free-threaded build
- We did not account for abandoned segments, which could miss blocks in
multithreaded runs.
- The mimalloc heap traversal needed to call "_mi_page_free_collect"
earlier in order to get an accurate count of blocks in use.
- `_Py_DecRefSharedDebug` was missing a `_Py_IncRefTotal`, but this was
mostly offset by a missing accounting in `_Py_ExplicitMergeRefcount`.
- get_num_global_allocated_blocks should pause other threads to ensure
that traversing the mimalloc heaps is safe.1 parent ed1a8da commit 1b17640
3 files changed
+16
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
541 | | - | |
542 | 541 | | |
543 | 542 | | |
544 | 543 | | |
| |||
635 | 634 | | |
636 | 635 | | |
637 | 636 | | |
| 637 | + | |
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
349 | 352 | | |
350 | 353 | | |
351 | 354 | | |
| |||
399 | 402 | | |
400 | 403 | | |
401 | 404 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | 405 | | |
407 | 406 | | |
408 | 407 | | |
409 | 408 | | |
410 | 409 | | |
411 | 410 | | |
412 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
413 | 416 | | |
414 | 417 | | |
415 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | | - | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
1077 | 1082 | | |
1078 | 1083 | | |
1079 | 1084 | | |
| |||
1189 | 1194 | | |
1190 | 1195 | | |
1191 | 1196 | | |
| 1197 | + | |
1192 | 1198 | | |
1193 | 1199 | | |
1194 | 1200 | | |
| |||
1208 | 1214 | | |
1209 | 1215 | | |
1210 | 1216 | | |
| 1217 | + | |
1211 | 1218 | | |
1212 | 1219 | | |
1213 | 1220 | | |
| |||
0 commit comments