Skip to content

gh-111903: Update AC to support "pycore_critical_section.h" header - #112251

Merged
corona10 merged 3 commits into
python:mainfrom
corona10:gh-111903
Nov 19, 2023
Merged

gh-111903: Update AC to support "pycore_critical_section.h" header#112251
corona10 merged 3 commits into
python:mainfrom
corona10:gh-111903

Conversation

@corona10

@corona10corona10 commented Nov 18, 2023

Copy link
Copy Markdown
Member

@corona10

Copy link
Copy Markdown
MemberAuthor

@colesbury IMO, we don't have to declare #include "pycore_critical_section.h" for AC things.

@colesburycolesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM

# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_critical_section.h"// Py_BEGIN_CRITICAL_SECTION()

Copy link
Copy Markdown
Member

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

@AlexWaygoodAlexWaygoodNov 19, 2023

Copy link
Copy Markdown
Member

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 :)

@corona10corona10Nov 19, 2023

Copy link
Copy Markdown
MemberAuthor

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

ifinclude.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)

Copy link
Copy Markdown
MemberAuthor

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.

@AlexWaygoodAlexWaygoodNov 19, 2023

Copy link
Copy Markdown
Member

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 :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@corona10@colesbury@AlexWaygood