Skip to content

Conversation

@corona10
Copy link
Member

@corona10corona10 commented Nov 18, 2023

@corona10
Copy link
MemberAuthor

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

Copy link
Contributor

@colesburycolesbury left a comment

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

Copy link
Member

@AlexWaygoodAlexWaygoodNov 19, 2023

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

Copy link
MemberAuthor

@corona10corona10Nov 19, 2023

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

Copy link
Member

@AlexWaygoodAlexWaygoodNov 19, 2023

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