[Python-ideas] CPython optimization: storing reference counters outside of objects

Amaury Forgeot d'Arc amauryfa at gmail.com
Mon May 23 20:22:14 CEST 2011


Hi,

2011/5/23 Sturla Molden <sturla at molden.no>:
> Instead, we could use multiple heaps:
>
> Each Python thread could manage it's own heap for malloc and free (cf.
> HeapAlloc and HeapFree in Windows). Objects local to one thread only reside
> in the locally managed heap.
>
> When an object becomes shared by seveeral Python threads, it is moved from a
> local heap to the global heap of the process. Some objects, such as modules,
> would be stored directly onto the global heap.

Does this mean that the PyObject* address would change?
How would you update all the places that store moved references?

--
Amaury Forgeot d'Arc



More information about the Python-ideas mailing list