]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40521: Make tuple free list per-interpreter (GH-20247)
authorVictor Stinner <vstinner@python.org>
Thu, 4 Jun 2020 21:38:36 +0000 (23:38 +0200)
committerGitHub <noreply@github.com>
Thu, 4 Jun 2020 21:38:36 +0000 (23:38 +0200)
commit69ac6e58fd98de339c013fe64cd1cf763e4f9bca
tree98ab5b8f851d5512f097a73292e871a89c11f873
parentdc24b8a2ac32114313bae519db3ccc21fe45c982
bpo-40521: Make tuple free list per-interpreter (GH-20247)

Each interpreter now has its own tuple free lists:

* Move tuple numfree and free_list arrays into PyInterpreterState.
* Define PyTuple_MAXSAVESIZE and PyTuple_MAXFREELIST macros in
  pycore_interp.h.
* Add _Py_tuple_state structure. Pass it explicitly to tuple_alloc().
* Add tstate parameter to _PyTuple_ClearFreeList()
* Each interpreter now has its own empty tuple singleton.
Include/internal/pycore_gc.h
Include/internal/pycore_interp.h
Include/internal/pycore_pylifecycle.h
Misc/NEWS.d/next/Core and Builtins/2020-05-20-01-17-34.bpo-40521.wvAehI.rst [new file with mode: 0644]
Modules/gcmodule.c
Objects/tupleobject.c
Python/pylifecycle.c