Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-92123: Pass _elementtree state as parameter#101189

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commentedJan 20, 2023
edited
Loading

@erlend-aasland
Copy link
ContributorAuthor

Passing the state around as a parameter is one way to get rid ofET_STATE_GLOBAL. It results in a larger diff (more churn), but IMO it is an ok approach. Alternatively, we can store state as a member in the type contexts, which will result in a smaller diff.

@erlend-aasland
Copy link
ContributorAuthor

(I willrebase this ontomain after#101187 has landed.)

Pass state as arg to create_new_element()
Pass state as arg to deepcopy()
Pass state as arg to expat_set_error()
Pass state as arg to element_setstate_from_attributes()
Pass state as arg to create_elementiter()
Pass state as arg to treebuilder_extend_element_text_or_tail()
Pass state as arg to treebuilder_add_subelement()
Pass state as arg to element_add_subelement()
Pass state as arg to element_setstate_from_Python()
@erlend-aaslanderlend-aaslandforce-pushed theetree/replace-query-with-param branch fromb853fba tofbd465aCompareJanuary 23, 2023 12:37
@erlend-aaslanderlend-aaslandforce-pushed theetree/replace-query-with-param branch fromfbd465a to0195c35CompareJanuary 23, 2023 12:41
@erlend-aaslanderlend-aasland marked this pull request as ready for reviewJanuary 23, 2023 12:54
@erlend-aasland
Copy link
ContributorAuthor

cc.@arhadthedev

@erlend-aasland
Copy link
ContributorAuthor

erlend-aasland commentedJan 23, 2023
edited
Loading

After this, the remaining parts are:

  • usePyModule_GetState where possible (1 small PR)
  • usePyType_GetModuleState where possible (1 slightly larger PR w/clinic changes)
  • usePyType_GetModuleByDef+PyModule_GetState where possible
  • adapt to multi-phase init
  • reapply the pyexpat-c-api-on-the-heap PR
arhadthedev reacted with thumbs up emoji

@kumaraditya303
Copy link
Contributor

kumaraditya303 commentedJan 24, 2023
edited
Loading

use PyModule_GetState where possible (1 small PR)
use PyType_GetModuleState where possible (1 slightly larger PR w/clinic changes)
use PyType_GetModuleByDef+PyModule_GetState where possible
adapt to multi-phase init

Up to you but I can review of all this in one go, they are relatively small changes.

erlend-aasland reacted with thumbs up emoji

@kumaraditya303
Copy link
Contributor

Side thought:sizeof(ElementObject) is56 which rounds off to64 for alignment so we can add a state pointer and the memory usage will be same.

erlend-aasland reacted with thumbs up emoji

@erlend-aasland
Copy link
ContributorAuthor

Side thought:sizeof(ElementObject) is56 which rounds off to64 for alignment so we can add a state pointer and the memory usage will be same.

Yes; well observed.

@erlend-aaslanderlend-aasland merged commitb2ac396 intopython:mainJan 24, 2023
@erlend-aaslanderlend-aasland deleted the etree/replace-query-with-param branchJanuary 24, 2023 11:45
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@kumaraditya303kumaraditya303kumaraditya303 approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@erlend-aasland@kumaraditya303@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp