-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Py_DECREF: only pass filename if Py_REF_DEBUG is defined #17870
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
Conversation
Filename and line numbers are not needed when Py_REF_DEBUG are not defined. The static inline _Py_DECREF() function was introduced by commit 2aaf0c1.
See PR #16781 for my first attempt. |
@Yhg1s @serhiy-storchaka: Does this version look better than PR #16781? |
cc @pablogsal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this looks better to me. The ifdef dance isn't too bad, and it's no longer duplicating logic.
Include/object.h
Outdated
#ifdef Py_REF_DEBUG | ||
const char *filename, int lineno, | ||
#endif | ||
PyObject *op) | ||
{ | ||
(void)filename; /* may be unused, shut up -Wunused-parameter */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These suppressions shouldn't be necessary anymore, but if they are, they should be conditional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suppression are needed with the current code, since filename & fileno are not used for a release build. It's the purpose of my change: don't pass them if we don't need them ;-)
) Filename and line numbers are not needed when Py_REF_DEBUG are not defined. The static inline _Py_DECREF() function was introduced by commit 2aaf0c1.
Filename and line numbers are not needed when Py_REF_DEBUG are not
defined.
The static inline _Py_DECREF() function was introduced by
commit 2aaf0c1.