Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect Py_TRACE_REFS at runtime and calculate object offsets accordingly #1426

Merged
merged 1 commit into from Apr 27, 2021

Conversation

lostmsu
Copy link
Member

@lostmsu lostmsu commented Mar 26, 2021

What does this implement/fix? Explain your changes.

This gets rid of #if PYTHON_WITH_PYDEBUG by detecting if objects have reference tracing (e.g. Py_TRACE_REFS) enabled at runtime based on the offset of refcount field in a new object.

Does this close any currently open issues?

It should fix #1412

Any other comments?

Slight refactoring had to be done to ensure initialization code does not depend on knowing field offsets until they actually become available.

@lostmsu lostmsu force-pushed the bugs/Py_DEBUG branch 2 times, most recently from de42b75 to 689f0d8 Compare Mar 31, 2021
Copy link
Contributor

@BadSingleton BadSingleton left a comment

LGTM

@lostmsu lostmsu merged commit db746aa into pythonnet:master Apr 27, 2021
25 of 26 checks passed
@lostmsu lostmsu deleted the bugs/Py_DEBUG branch Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants