-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-113993: Allow interned strings to be mortal, and fix related issues #120520
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
2b74021
Declare explicit interning routines
encukou 0aedb83
Use _PyUnicode_InternStatic for the statically allocated stuff
encukou aad79b2
Add _PyUnicode_InternStatic and extra checks
encukou 5413223
Check against immortalizing un-interned strings
encukou 23845fb
Add _PyUnicode_InternImmortal & make `marshal` use it
encukou 9ece220
Remove special case that makes previously-immortal strings STATIC
encukou 7c62641
Split _PyUnicode_InternMortal and _PyUnicode_InternImmortal
encukou 62a35a1
Do the refcnt dance in _PyUnicode_InternMortal & _PyUnicode_ClearInte…
encukou ac55a05
Deallocate mortal interned strings
encukou 2466ae9
Use _PyUnicode_InternMortal in codecs
encukou 032ac17
Start a notes document
encukou 198d9c6
Handle attempts to "overwrite" interned heap types by static ones
encukou 86ccb08
Intern statically allocated non-identifier strings at init
encukou e34b8da
Parenthesize the LATIN1 macro argument
encukou 66338fe
Don't create the per-interp interned_dict until after InitStaticStrings
encukou 9f16cb0
Move hashmap destroy to _PyUnicode_ClearInterned (symmetry with creat…
encukou e27abfc
Special-case short string singletons
encukou 89f24df
Verify we don't add process-global entries after a per-interp dict ex…
encukou b965acf
More editing of the InternalDocs write-up
encukou 4b69712
Only readjust refleak tests for *immortal* interned strings
encukou b2c9865
Be pedantic with the ref total
encukou cf7cb72
Split InternInPlace in sysmodule
encukou 85f9fe0
Split InternInPlace in import
encukou a288389
Split InternInPlace in getargs
encukou 6036cb1
Use mortal strings in type_setattro
encukou 01f2dbf
Use mortal string in type_module
encukou 73f7fb3
Use mortal strings for object attributes
encukou 13be4e7
Use mortal strings for code object names
encukou 1930919
Use mortal strings for code constants
encukou d45f20b
Use mortals in pickle
encukou 348d95c
Use mortals for PyDict_SetItemString keys
encukou 04f080e
Use mortals in operator: methodcaller_new
encukou afe5400
Use mortals in operator: attrgetter_new
encukou fe0b8c5
Simplify logic in _PyUnicode_InternImmortal
encukou 1116191
Immortalize ill interned strings in the free-threaded build
encukou f10e521
Rewrite the write-up
encukou 0787f8f
Restore immortalization for PyDict_SetItemString.
encukou 0d56eba
Intern single-byte (latin1) strings at startup in free-threaded build
encukou 8b32762
Make the three sets of singletons disjoint
encukou 24bf76a
One more single-char string in _Py_STR
encukou 2fb04fd
Use a less unwieldy name
encukou 26fa26e
Adjust comments & writeup
encukou 9b14dbb
Don't call _Py_SetImmortal on strings.
encukou ac6dfae
Beef up the tests
encukou a9e91b1
Fix comment
encukou ee0f068
A bit more thought-through error handling for failed PyDict_Pop
encukou 61bf404
Switch parser to PyUnicode_InternImmortal
encukou 80ce95b
Touch up comments
encukou 70aa294
Switch public PyUnicode API to _PyUnicode_InternImmortal
encukou de2ff7f
Add an assert to _PyUnicode_EqualToASCIIId
encukou 0e6744e
Remove #ifdef Py_DEBUG from the body of _PyUnicode_ClearInterned.
encukou c50e151
Consolidate the interning logic
encukou 08798d0
Fix the free-threading initialization
encukou 62959cd
Typo in comments
encukou f62ccc6
Add blurb
encukou 86cf124
Guard call to debug function
encukou f2e857e
Avoid -bb warnings in tests
encukou 6011c05
Add typing to a clinic function
encukou 7e8d727
Work around build failure on macOS clang
encukou ccb7f42
Silence a mypy error
encukou e0bb1c2
_PyCodec_Lookup: Immortalize key on success
encukou 975e4ba
getargs.c: Immortalize the kwtuple keys
encukou 1c05a60
Don't re-mortalize interned immortals at interpreter shutdown (in non…
encukou 5ac3c5f
Avoid `case` label on a declaration (invalid in standard C and, fortu…
encukou 686d2b6
Merge in the main branch
encukou 7d79d10
Remove PyUnicode_InternImmortal from the header
encukou d4eb879
Move _Py_LATIN1_CHR to pycore_global_strings.h
encukou f7df09a
Remove mistaken check in _pickle.c
encukou fe7fb13
Comment/doc clarifications, rewordings; PEP-7 style
encukou 7a75099
Add a pedantic DECREF
encukou ac402d8
Use more straightforward signatures for the internal functions
encukou aa58c01
Group _PyUnicode_Intern funcs in the header
encukou 929d0bc
Break out init_global_interned_strings & clear_global_interned_strings
encukou 44c0192
Merge in the main branch
encukou 9e3ce44
Fix function declaration
encukou 2ebf8a0
Fix return value
encukou bf49f61
Convert check to assert
encukou 6d668e6
Limit _PyUnicode_InternStatic to runtime initialization
encukou fd8ca83
Add a comment for _Py_hashtable_new_full destroys
encukou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Move hashmap destroy to _PyUnicode_ClearInterned (symmetry with creat…
…ion)
- Loading branch information
commit 9f16cb0c99c5486bfc651a271ce7cbb284e0eca8
There are no files selected for viewing
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.