Commit b331381
authored
* gh-112529: Track if debug allocator is used as underlying allocator
The GC implementation for free-threaded builds will need to accurately
detect if the debug allocator is used because it affects the offset of
the Python object from the beginning of the memory allocation. The
current implementation of `_PyMem_DebugEnabled` only considers if the
debug allocator is the outer-most allocator; it doesn't handle the case
of "hooks" like tracemalloc being used on top of the debug allocator.
This change enables more accurate detection of the debug allocator by
tracking when debug hooks are enabled.
* Simplify _PyMem_DebugEnabled
1 parent c86571e commit b331381
File tree
4 files changed
+21
-6
lines changed- Include/internal
- Objects
4 files changed
+21
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| 110 | + | |
| 111 | + | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| 442 | + | |
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
445 | 446 | | |
446 | 447 | | |
447 | 448 | | |
| 449 | + | |
448 | 450 | | |
449 | 451 | | |
450 | 452 | | |
| |||
458 | 460 | | |
459 | 461 | | |
460 | 462 | | |
461 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
462 | 466 | | |
463 | 467 | | |
464 | 468 | | |
| |||
477 | 481 | | |
478 | 482 | | |
479 | 483 | | |
480 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
481 | 487 | | |
482 | 488 | | |
483 | 489 | | |
| |||
493 | 499 | | |
494 | 500 | | |
495 | 501 | | |
496 | | - | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
497 | 505 | | |
498 | 506 | | |
499 | 507 | | |
| |||
604 | 612 | | |
605 | 613 | | |
606 | 614 | | |
607 | | - | |
608 | | - | |
| 615 | + | |
609 | 616 | | |
610 | 617 | | |
611 | | - | |
| 618 | + | |
612 | 619 | | |
613 | 620 | | |
| 621 | + | |
614 | 622 | | |
615 | 623 | | |
616 | 624 | | |
| |||
695 | 703 | | |
696 | 704 | | |
697 | 705 | | |
| 706 | + | |
698 | 707 | | |
699 | 708 | | |
700 | 709 | | |
| |||
0 commit comments