mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-115103: Enable internal mimalloc assertions in debug builds (#116343)
This sets `MI_DEBUG` to `2` in debug builds to enable `mi_assert_internal()` calls. Expensive internal assertions are not enabled. This also disables an assertion in free-threaded builds that would be triggered by the free-threaded GC because we traverse heaps that are not owned by the current thread.
This commit is contained in:
parent
dab85e0189
commit
72714c0266
2 changed files with 4 additions and 1 deletions
|
@ -609,7 +609,10 @@ bool _mi_free_delayed_block(mi_block_t* block) {
|
|||
// get segment and page
|
||||
const mi_segment_t* const segment = _mi_ptr_segment(block);
|
||||
mi_assert_internal(_mi_ptr_cookie(segment) == segment->cookie);
|
||||
#ifndef Py_GIL_DISABLED
|
||||
// The GC traverses heaps of other threads, which can trigger this assert.
|
||||
mi_assert_internal(_mi_thread_id() == segment->thread_id);
|
||||
#endif
|
||||
mi_page_t* const page = _mi_segment_page_of(segment, block);
|
||||
|
||||
// Clear the no-delayed flag so delayed freeing is used again for this page.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue