GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — gh-131238: Move _Py_VISIT_STACKREF() to pycore_stackref.h by vstinner · Pull Request #131560 · python/cpython Conversation
|
| #define _Py_VISIT_STACKREF(ref) \ | ||
| do { \ | ||
| if (!PyStackRef_IsNull(ref)) { \ | ||
| int vret = _PyGC_VisitStackRef(&(ref), visit, arg); \ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This depends on _PyGC_VisitStackRef, which is in pycore_gc.h.
What's the motivation for moving the macro here?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
pycore_stackref.h depends on pycore_object.h which depends on pycore_gc.h.
_Py_VISIT_STACKREF() (currently defined in pycore_gc.h) uses PyStackRef_IsNull() which is defined in pycore_stackref.h.
Problem: If dependencies are made explicit (that's part of my work), pycore_gc.h should depend on pycore_stackref.h which creates a dependency cycle!
Moving _Py_VISIT_STACKREF() to pycore_stackref.h breaks this cycle.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Previously, using _Py_VISIT_STACKREF() without including pycore_stackref.h worked thanks to luck and the fact that including one header pulled dozens of other headers. With my work on reducing dependencies, this luck is gone, and dependencies must be written explicitly.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.