-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-111903: Update AC to support "pycore_critical_section.h" header #112251
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
@colesbury IMO, we don't have to declare |
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.
Nice! LGTM
@@ -6,6 +6,7 @@ preserve | |||
# include "pycore_gc.h" // PyGC_Head | |||
# include "pycore_runtime.h" // _Py_ID() | |||
#endif | |||
#include "pycore_critical_section.h"// Py_BEGIN_CRITICAL_SECTION() |
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 formatting isn't great here: it would be nice if the generated code had at least one space (preferably two) before each inline comment
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.
(This can be dealt with in a followup PR, though, if you'd prefer to merge this one quickly :)
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.
IMO, It will affect the overall generated code formatting since we have to touch
cpython/Tools/clinic/clinic.py
Lines 2347 to 2350 in 1a969b4
if include.reason: | |
comment = f'// {include.reason}\n' | |
line = line.ljust(INCLUDE_COMMENT_COLUMN - 1) + comment | |
output += line |
So, let's handle it as a separate PR, @AlexWaygood would you like to touch it?
(Easy way might just updating
INCLUDE_COMMENT_COLUMN
but there might be smarter policy rather than fixed policy)
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.
Simply updating INCLUDE_COMMENT_COLUMN
to 38 will resolve this issue.
But IMO, this value should be adaptively chosen.
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.
I'll try to find some time in the next few days to look at it, but can't guarantee it right now!
Anyway, I'm happy to defer this for now; it's definitely not the most important thing in the world :)
Py_BEGIN_CRITICAL_SECTION()
) #111903