]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-115103: Implement delayed free mechanism for free-threaded builds (#115367)
authorSam Gross <colesbury@gmail.com>
Tue, 20 Feb 2024 18:04:37 +0000 (13:04 -0500)
committerGitHub <noreply@github.com>
Tue, 20 Feb 2024 18:04:37 +0000 (13:04 -0500)
commite3ad6ca56f9b49db0694f432a870f907a8039f79
treee04a42ed027f6595dec9efe051104d487cfb03a8
parentd207c7cd5a8c0d3e5f6c5eb947243e4afcd718b0
gh-115103: Implement delayed free mechanism for free-threaded builds (#115367)

This adds `_PyMem_FreeDelayed()` and supporting functions. The
`_PyMem_FreeDelayed()` function frees memory with the same allocator as
`PyMem_Free()`, but after some delay to ensure that concurrent lock-free
readers have finished.
Include/internal/pycore_interp.h
Include/internal/pycore_pymem.h
Include/internal/pycore_pymem_init.h
Include/internal/pycore_runtime_init.h
Include/internal/pycore_tstate.h
Objects/obmalloc.c
Python/pylifecycle.c
Python/pystate.c