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-103082: Fix shifted field initialization in `instrumentation.c` by arhadthedev · Pull Request #103561 · python/cpython Conversation
|
| static PyObject DISABLE = | |
| { | |
| _PyObject_IMMORTAL_REFCNT, | |
| &PyBaseObject_Type | |
| }; |
_ob_next = _PyObject_IMMORTAL_REFCNT (999999999)
_ob_prev = &PyBaseObject_Type
ob_refcnt = 0
ob_type = NULL
The reason is implicit insertion of two extra fields under #ifdef Py_TRACE_REFS:
Lines 102 to 106 in 2b6f5c3
| struct _object { | |
| _PyObject_HEAD_EXTRA | |
| Py_ssize_t ob_refcnt; | |
| PyTypeObject *ob_type; | |
| }; |
Lines 65 to 76 in 2b6f5c3
| #ifdef Py_TRACE_REFS | |
| /* Define pointers to support a doubly-linked list of all live heap objects. */ | |
| #define _PyObject_HEAD_EXTRA \ | |
| PyObject *_ob_next; \ | |
| PyObject *_ob_prev; | |
| #define _PyObject_EXTRA_INIT _Py_NULL, _Py_NULL, | |
| #else | |
| # define _PyObject_HEAD_EXTRA | |
| # define _PyObject_EXTRA_INIT | |
| #endif |
This commit fixes declarations that fail the (edit: all other places use AMD64 Arch Linux TraceRefs PR buildbot. Other declarations will be fixed in another, pending PR._PyObject_HEAD_EXTRA)
I desided to not use _PyObject_HEAD_EXTRA because it can be forgotten easily (unlike explicit field names) so we should phase it out from CPython codebase if possible.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @arhadthedev for commit 286fdc9 🤖 If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
instrumentation.cinstrumentation.c
|
@markshannon as an author of gh-103083 this PR fixes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| { | ||
| _PyObject_IMMORTAL_REFCNT, | ||
| &PyBaseObject_Type | ||
| .ob_refcnt = _PyObject_IMMORTAL_REFCNT, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Explicit setting of these fields seems a bit odd to me.
@markshannon should review and merge it since this is recently introduced file.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think the use of named initializers is fine. Since we can always change it to use macros later, and this fixes compilation, I'm merging this. |
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.