diff options
author | Eddie Elizondo <eduardo.elizondorueda@gmail.com> | 2023-04-22 15:39:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-22 13:39:37 -0600 |
commit | ea2c0016502472aa8baa3149050ada776d17a009 (patch) | |
tree | e9e3935a9b71a1f88ac18c24fe512d199880ff90 /Python/pylifecycle.c | |
parent | 916de04fd1838530096336aadb3b94b774ed6c90 (diff) | |
download | cpython-ea2c0016502472aa8baa3149050ada776d17a009.tar.gz cpython-ea2c0016502472aa8baa3149050ada776d17a009.zip |
gh-84436: Implement Immortal Objects (gh-19474)
This is the implementation of PEP683
Motivation:
The PR introduces the ability to immortalize instances in CPython which bypasses reference counting. Tagging objects as immortal allows up to skip certain operations when we know that the object will be around for the entire execution of the runtime.
Note that this by itself will bring a performance regression to the runtime due to the extra reference count checks. However, this brings the ability of having truly immutable objects that are useful in other contexts such as immutable data sharing between sub-interpreters.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index d6627bc6b7e..a510c9b2216 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -808,11 +808,6 @@ pycore_interp_init(PyThreadState *tstate) PyStatus status; PyObject *sysmod = NULL; - // This is a temporary fix until we have immortal objects. - // (See _PyType_InitCache() in typeobject.c.) - extern void _PyType_FixCacheRefcounts(void); - _PyType_FixCacheRefcounts(); - // Create singletons before the first PyType_Ready() call, since // PyType_Ready() uses singletons like the Unicode empty string (tp_doc) // and the empty tuple singletons (tp_bases). |