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-90868: Add _PyStaticObject_CheckRefcnt() function by vstinner · Pull Request #99261 · python/cpython Conversation
|
|
@ericsnowcurrently @kumaraditya303: This PR makes _PyStaticObjects_CheckRefcnt() more readable and shorter, what do you think? |
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.
I have one suggestion. Otherwise this looks good.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| static inline void | ||
| _PyStaticObject_CheckRefcnt(PyObject *obj) { | ||
| if (Py_REFCNT(obj) < _PyObject_IMMORTAL_REFCNT) { | ||
| _PyObject_ASSERT_FAILED_MSG(obj, | ||
| "immortal object has less refcnt than expected " | ||
| "_PyObject_IMMORTAL_REFCNT"); | ||
| } | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Rather that being part of the generated code, you could put this directly in pycore_global_objects_fini_generated.h, before the /* The following is auto-generated by Tools/build/generate_global_objects.py. */ marker line.
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.
Aha, I didn't notice that only some parts of this file are generated. Ok, I added my new function at the top.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add _PyStaticObject_CheckRefcnt() function to make _PyStaticObjects_CheckRefcnt() shorter. Use _PyObject_ASSERT_FAILED_MSG() to log the object causing the fatal error.
|
I have made the requested changes; please review again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @ericsnowcurrently: please review the changes made to this pull request. |
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.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Merged, thanks for the review. |
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.