Skip to content

gh-112529: Track if debug allocator is used as underlying allocator#113747

Merged
DinoV merged 2 commits intopython:mainfrom
colesbury:gh-112529-mem-debug
Jan 16, 2024
Merged

gh-112529: Track if debug allocator is used as underlying allocator#113747
DinoV merged 2 commits intopython:mainfrom
colesbury:gh-112529-mem-debug

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Jan 5, 2024

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.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants