Author methane
Recipients methane, pitrou, serhiy.storchaka
Date 2018-05-22.15:49:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>

php implemented similar idea recently.

In short, each tracked object have only "index" of GC struct, not "pointer".
GC struct is in array and it can be resized.

I tried to copy it, but there are some challenges:

* _PyObject_GC_TRACK() will resize GC array and cause MemoryError.  It's not API compatible.
* php's GC is not generational. This design may slow down moving objects between generation.
* We need one word (index) for object header and two words (refcnt, pointer to the object) for GC struct.  It means we can reduce memory footprint only for untracked dicts and tuples.

And this is my first time GC hack.  So I gave up PHP way and choose easier way.

Anyway, we have gc.freeze() now which can be used for avoid CoW after fork.
Date User Action Args
2018-05-22 15:49:07methanesetrecipients: + methane, pitrou, serhiy.storchaka
2018-05-22 15:49:07methanesetmessageid: <>
2018-05-22 15:49:07methanelinkissue33597 messages
2018-05-22 15:49:07methanecreate