-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-92953: Add description source to struct pool_header
#124996
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
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
struct pool_header
struct pool_header
The
In the 'used' state, it says
When we are in 'full' state, it says that
so the comment is still correct. As for the 'empty' state,
and
So technically, only the change on the
I think it's more important to know that we are within the same size class in the comment though than to just have a 'next pool'. If you want to make the change, I'd advise also checking the corresponding |
The important part of this change is that the comment for
And I will check out other descriptions of this structure in |
I'm sorry, I need to add something to this. I found the comment snippet you listed in pycore_obmalloc.h. As you mentioned, it has already explained the use of this field in detail in this snippet, so in fact, it may not be necessary to explain the function of |
The meaning is more a typographic meaning in English not really with CPython or computer sciences in general. More precisely, /*
* First line does: ABC DEF
* Second line does: ""
*/ is equivalent to /*
* First line does: ABC DEF
* Second line does: ABC DEF
*/
I think it's more important to read the big comment above the structure which explains the different states quite well rather than the structure itself.
Well.. in the 'full' state neither nextpool nor prevpool have a meaning so the comment would be useless in this case as well. I think Eric decided to keep the comment tight to what is an "effective and useful" state, namely the "used" state. |
Maybe I shouldn't remove the "", but this change comes from here.
Maybe I should try to describe it in brief terms. |
I would either do nothing or do what you did (namely just write 'next pool' and 'previous pool'). But if we just keep 'next pool' and 'previous pool' in the comments, I feel we do not gain anything since the attribute names As such, I don't think we need to change what's already written but I'll leave that to Eric to decide. |
I think what you said makes sense, so how do you think this modification works?
I think if Like the comment it
|
No I really don't like duplicating the comment. There is no real gain for most of the users. It's already explained once clearly. The reason why nextarena is explained at the structure level is because it's only documented once here (I couldn't find any other reference). If we wanted to be both concise and helpful, the best way to document it is to update the structure comment itself to |
Ideally, we could even just remove the entire section on arena management and pools and move them to an internal documentation. This part of the code is not exposed to external users and is really implementation details so documentation does not need to target the regular user. |
Hmmm, I agree, So |
struct pool_header
struct pool_header
struct pool_header
nextpool
in struct pool_header
nextpool
in struct pool_header
struct pool_header
The comment has been there since 2001; it's for a strictly internal API/data structure, and it has not caused confusion within the core dev team. Let's just keep it. Thanks for the PR. |
Uh oh!
There was an error while loading. Please reload this page.