Commit 0794220
We should maintain the invariant that a zero `ob_tid` implies the
refcount fields are merged.
* Move the assignment in `_Py_MergeZeroLocalRefcount` to immediately
before the refcount merge.
* Update `_PyTrash_thread_destroy_chain` to set `ob_ref_shared` to
`_Py_REF_MERGED` when setting `ob_tid` to zero.
Also check this invariant with assertions in the GC in debug builds.
That uncovered a bug when running out of memory during GC.
(cherry picked from commit d23be39)
Co-authored-by: Sam Gross <colesbury@gmail.com>
1 parent 6396c77 commit 0794220
File tree
3 files changed
+62
-13
lines changed- Misc/NEWS.d/next/Core and Builtins
- Objects
- Python
3 files changed
+62
-13
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
379 | 378 | | |
380 | 379 | | |
381 | 380 | | |
382 | 381 | | |
383 | 382 | | |
384 | 383 | | |
385 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
386 | 390 | | |
387 | 391 | | |
388 | 392 | | |
| |||
2739 | 2743 | | |
2740 | 2744 | | |
2741 | 2745 | | |
2742 | | - | |
2743 | 2746 | | |
2744 | 2747 | | |
2745 | 2748 | | |
| |||
2772 | 2775 | | |
2773 | 2776 | | |
2774 | 2777 | | |
| 2778 | + | |
2775 | 2779 | | |
2776 | 2780 | | |
2777 | 2781 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
458 | 482 | | |
459 | 483 | | |
460 | 484 | | |
| |||
498 | 522 | | |
499 | 523 | | |
500 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
501 | 538 | | |
502 | 539 | | |
503 | 540 | | |
| |||
549 | 586 | | |
550 | 587 | | |
551 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
552 | 596 | | |
553 | 597 | | |
554 | 598 | | |
| |||
563 | 607 | | |
564 | 608 | | |
565 | 609 | | |
| 610 | + | |
| 611 | + | |
566 | 612 | | |
567 | 613 | | |
568 | 614 | | |
| |||
1066 | 1112 | | |
1067 | 1113 | | |
1068 | 1114 | | |
1069 | | - | |
| 1115 | + | |
| 1116 | + | |
1070 | 1117 | | |
1071 | 1118 | | |
1072 | 1119 | | |
| |||
1100 | 1147 | | |
1101 | 1148 | | |
1102 | 1149 | | |
1103 | | - | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1104 | 1156 | | |
1105 | 1157 | | |
1106 | 1158 | | |
| |||
1110 | 1162 | | |
1111 | 1163 | | |
1112 | 1164 | | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | 1165 | | |
1123 | 1166 | | |
1124 | 1167 | | |
| |||
0 commit comments