mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
916de04fd1
commit
ea2c001650
35 changed files with 483 additions and 171 deletions
|
@ -184,7 +184,6 @@ typedef Py_ssize_t Py_ssize_clean_t;
|
|||
# define Py_LOCAL_INLINE(type) static inline type
|
||||
#endif
|
||||
|
||||
// bpo-28126: Py_MEMCPY is kept for backwards compatibility,
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define Py_MEMCPY memcpy
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue