FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-103583: Isolate CJK codec modules by erlend-aasland · Pull Request #103869 · python/cpython · GitHub

Repository navigation

gh-103583: Isolate CJK codec modules - #103869

Merged
erlend-aasland merged 7 commits into
python:mainfrom
erlend-aasland:isolate-cjk-alt2
Apr 27, 2023
Merged

erlend-aasland merged 7 commits into
python:mainfrom
erlend-aasland:isolate-cjk-alt2

Conversation

erlend-aasland commented Apr 26, 2023 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

erlend-aasland marked this pull request as ready for review April 26, 2023 13:15

Copy link
Copy Markdown
Contributor Author

This approach exploits the dependency introduced in gh-103589; we know for sure that the _codec* extension modules will outlive _multibytecodec. This means we can store the cjk codec module state safely in the codec struct and modify the various codec handlers to accept the codec struct (iso. void *config). Then we add custom cjk module state where needed, and conveniently fetch it from the codec struct. (Quick and dirty explanation; see the code if what I wrote does not make sense 😎)

erlend-aasland added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Apr 26, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit ef983c4 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Apr 26, 2023

Copy link
Copy Markdown
Contributor Author

BTW, I removed the initialized guards. I'm pretty sure we can do that, but I haven't verified it yet.

erlend-aasland commented Apr 26, 2023 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

Also, we can split out cb2c9e7 as a separate PR. That may be beneficial regarding to future bisects; it will also make this PR easier to review.

Similarly, f6ed5df can be split up to do the arg spec changes first, and then move stuff to module state afterwards.

Copy link
Copy Markdown
Contributor Author

@vstinner, you want to take a look? :)

Copy link
Copy Markdown
Member

@erlend-aasland I will take a look by tomorrow

Copy link
Copy Markdown
Contributor Author

(Pulling in main to get the latest ref. leak fixes by Jelle)

erlend-aasland added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Apr 26, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit dec79a7 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Apr 26, 2023
erlend-aasland changed the title gh-103583: Isolate CJK modules, alternative 2 gh-103583: Isolate CJK codec modules Apr 26, 2023
erlend-aasland linked an issue Apr 26, 2023 that may be closed by this pull request

corona10 left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, This is quite a complicated but nice approach. But nothing can be better than this.
Thanks for the hard work!

Copy link
Copy Markdown
Contributor Author

Thanks for the review, Dong-hee! Yes, it is complicated, but as shown in my competing PRs, other approaches are even more complicated.

erlend-aasland merged commit 8a0c7f1 into python:main Apr 27, 2023
erlend-aasland deleted the isolate-cjk-alt2 branch April 27, 2023 13:02

vstinner commented May 4, 2023

Copy link
Copy Markdown
Member

Well done @erlend-aasland!

Copy link
Copy Markdown
Contributor Author

Well done @erlend-aasland!

Thanks, Victor :) This was a tricky one!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Isolate _multibytecodec

5 participants


Back | FazBrowse Home | New Git URL