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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user