cpython/Python
Eric Snow b72947a8d2
gh-106931: Intern Statically Allocated Strings Globally (gh-107272)
We tried this before with a dict and for all interned strings.  That ran into problems due to interpreter isolation.  However, exclusively using a per-interpreter cache caused some inconsistency that can eliminate the benefit of interning.  Here we circle back to using a global cache, but only for statically allocated strings.  We also use a more-basic _Py_hashtable_t for that global cache instead of a dict.

Ideally we would only have the global cache, but the optional isolation of each interpreter's allocator means that a non-static string object must not outlive its interpreter.  Thus we would have to store a copy of each such interned string in the global cache, tied to the main interpreter.
2023-07-27 13:56:59 -06:00
..
clinic
deepfreeze
frozen_modules
_warnings.c gh-106320: Remove private _PyDict C API (#107145) 2023-07-24 14:02:03 +00:00
adaptive.md
asdl.c
asm_trampoline.S
assemble.c gh-105481: move Python/opcode_metadata.h to Include/internal/pycore_opcode_metadata.h (#106673) 2023-07-12 11:30:25 +01:00
ast.c
ast_opt.c gh-106320: Move private _PySet API to the internal API (#107041) 2023-07-22 17:04:34 +02:00
ast_unparse.c
bltinmodule.c gh-106320: Remove private _PyDict C API (#107145) 2023-07-24 14:02:03 +00:00
bootstrap_hash.c gh-106320: Remove private pylifecycle.h functions (#106400) 2023-07-04 09:41:43 +00:00
bytecodes.c GH-106895: Raise a ValueError when attempting to disable events that cannot be disabled. (GH-107337) 2023-07-27 15:27:11 +01:00
ceval.c GH-106898: Add the exception as an argument to the PY_UNWIND event callback function. (GH-107347) 2023-07-27 15:47:33 +01:00
ceval_gil.c GH-104584: Fix ENTER_EXECUTOR (GH-106141) 2023-07-03 21:28:27 +01:00
ceval_macros.h GH-106701: Move _PyUopExecute to Python/executor.c (GH-106924) 2023-07-20 20:37:19 +00:00
codecs.c gh-106521: Remove _PyObject_LookupAttr() function (GH-106642) 2023-07-12 08:57:10 +03:00
compile.c gh-106149: fix comment on stackdepth of generators (#107321) 2023-07-26 22:31:47 +00:00
condvar.h
context.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
dtoa.c
dup2.c
dynamic_annotations.c
dynload_hpux.c
dynload_shlib.c
dynload_stub.c
dynload_win.c
emscripten_signal.c
errors.c gh-106521: Remove _PyObject_LookupAttr() function (GH-106642) 2023-07-12 08:57:10 +03:00
executor.c gh-106320: Move private _PySet API to the internal API (#107041) 2023-07-22 17:04:34 +02:00
executor_cases.c.h GH-106895: Raise a ValueError when attempting to disable events that cannot be disabled. (GH-107337) 2023-07-27 15:27:11 +01:00
fileutils.c
flowgraph.c gh-106149: Simplify stack depth calculation. Replace asserts by exceptions. (#107255) 2023-07-26 13:32:47 +01:00
formatter_unicode.c
frame.c
frozen.c
frozenmain.c
future.c gh-106320: Remove more private _PyUnicode C API functions (#106382) 2023-07-03 22:35:46 +00:00
generated_cases.c.h GH-106895: Raise a ValueError when attempting to disable events that cannot be disabled. (GH-107337) 2023-07-27 15:27:11 +01:00
getargs.c gh-107196: Remove _PyArg_VaParseTupleAndKeywordsFast() function (#107197) 2023-07-27 16:36:54 +02:00
getcompiler.c
getcopyright.c
getopt.c
getplatform.c
getversion.c
hamt.c
hashtable.c gh-106931: Intern Statically Allocated Strings Globally (gh-107272) 2023-07-27 13:56:59 -06:00
import.c Remove unused internal _PyImport_GetModuleId() function (#107235) 2023-07-25 17:02:12 +00:00
importdl.c gh-106320: Remove private _PyErr C API functions (#106356) 2023-07-03 10:48:50 +00:00
importdl.h
initconfig.c
instrumentation.c GH-106895: Raise a ValueError when attempting to disable events that cannot be disabled. (GH-107337) 2023-07-27 15:27:11 +01:00
intrinsics.c gh-105481: do not auto-generate pycore_intrinsics.h (#106913) 2023-07-20 17:46:04 +01:00
legacy_tracing.c GH-106898: Add the exception as an argument to the PY_UNWIND event callback function. (GH-107347) 2023-07-27 15:47:33 +01:00
makeopcodetargets.py
marshal.c gh-106320: Move private _PySet API to the internal API (#107041) 2023-07-22 17:04:34 +02:00
modsupport.c bpo-42327: C API: Add PyModule_Add() function (GH-23443) 2023-07-18 09:42:05 +03:00
mysnprintf.c
mystrtoul.c
opcode_targets.h GH-100288: Specialize LOAD_ATTR for simple class attributes. (#105990) 2023-07-10 11:40:35 +01:00
optimizer.c GH-104584: Miscellaneous fixes for -Xuops (GH-106908) 2023-07-20 16:35:39 +00:00
pathconfig.c
perf_trampoline.c
preconfig.c gh-106320: Remove private pylifecycle.h functions (#106400) 2023-07-04 09:41:43 +00:00
pyarena.c
pyctype.c
pyfpe.c
pyhash.c gh-106320: Move private _PyHash API to the internal C API (#107026) 2023-07-22 13:49:37 +00:00
pylifecycle.c gh-106320: Move private _PySet API to the internal API (#107041) 2023-07-22 17:04:34 +02:00
pymath.c
pystate.c GH-103082: Rename PY_MONITORING_EVENTS to _PY_MONITORING_EVENTS (#107069) 2023-07-22 21:35:27 +00:00
pystrcmp.c
pystrhex.c gh-106320: Remove _PyUnicode_TransformDecimalAndSpaceToASCII() (#106398) 2023-07-04 08:59:09 +00:00
pystrtod.c
Python-ast.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
Python-tokenize.c gh-107015: Remove async_hacks from the tokenizer (#107018) 2023-07-26 16:34:15 +01:00
pythonrun.c gh-106521: Remove _PyObject_LookupAttr() function (GH-106642) 2023-07-12 08:57:10 +03:00
pytime.c
README
specialize.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
stdlib_module_names.h
structmember.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
suggestions.c gh-106521: Remove _PyObject_LookupAttr() function (GH-106642) 2023-07-12 08:57:10 +03:00
symtable.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
sysmodule.c gh-106320: Remove private _PyDict C API (#107145) 2023-07-24 14:02:03 +00:00
thread.c
thread_nt.h
thread_pthread.h
thread_pthread_stubs.h
traceback.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
tracemalloc.c

Miscellaneous source files for the main Python shared library