mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-130030: Fix crash on 32-bit Linux with free threading (gh-130043)
The `gc_get_refs` assertion needs to be after we check the alive and unreachable bits. Otherwise, `ob_tid` may store the actual thread id instead of the computed `gc_refs`, which may trigger the assertion if the `ob_tid` looks like a negative value. Also fix a few type warnings on 32-bit systems.
This commit is contained in:
parent
791cdfe141
commit
e09442089e
2 changed files with 13 additions and 11 deletions
|
@ -3297,12 +3297,12 @@ static bool _collect_alloc_stats(
|
|||
static void
|
||||
py_mimalloc_print_stats(FILE *out)
|
||||
{
|
||||
fprintf(out, "Small block threshold = %zd, in %u size classes.\n",
|
||||
MI_SMALL_OBJ_SIZE_MAX, MI_BIN_HUGE);
|
||||
fprintf(out, "Medium block threshold = %zd\n",
|
||||
MI_MEDIUM_OBJ_SIZE_MAX);
|
||||
fprintf(out, "Large object max size = %zd\n",
|
||||
MI_LARGE_OBJ_SIZE_MAX);
|
||||
fprintf(out, "Small block threshold = %zu, in %u size classes.\n",
|
||||
(size_t)MI_SMALL_OBJ_SIZE_MAX, MI_BIN_HUGE);
|
||||
fprintf(out, "Medium block threshold = %zu\n",
|
||||
(size_t)MI_MEDIUM_OBJ_SIZE_MAX);
|
||||
fprintf(out, "Large object max size = %zu\n",
|
||||
(size_t)MI_LARGE_OBJ_SIZE_MAX);
|
||||
|
||||
mi_heap_t *heap = mi_heap_get_default();
|
||||
struct _alloc_stats stats;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue