[pypy-dev] cpyext reference counting and other gc's

Dima Tisnek dimaqq at gmail.com
Mon Apr 25 21:53:36 CEST 2011


Apologies that it took a little long

Here is the doc describing the idea and its side effects

https://docs.google.com/document/d/1k7t-WIsfKW4tIL9i8-7Y6_9lo18wcsibyDONOF2i_l8/edit?hl=en

Since many of you are now busy with release, I'm only asking for quick
feedback, especially if I missed something obvious.

Thanks,
Dima Tisnek

On 26 March 2011 10:03, Dima Tisnek <dimaqq at gmail.com> wrote:
> I have an alternative idea in mind
>
> I'll write up a doc, stick it on github and share with you guys in a
> couple of days
>
> thanks for a clear answer, I just couldn't figure that out form code easily :P
>
> d.
>
> On 26 March 2011 01:33, Amaury Forgeot d'Arc <amauryfa at gmail.com> wrote:
>> Hi,
>>
>> 2011/3/26 Dima Tisnek <dimaqq at gmail.com>:
>>> Hey, I had a look at cpyext recently and saw that reference counting
>>> is emulated with, err, reference counting, seeminlgy in the referenced
>>> object itself.
>>>
>>> Does this mean that cpyext would not work with other gc's or is there
>>> some wrapping going on behind the scenes?
>>
>> Cpyext works with all pypy gc's. The PyObject* exposed to C code is actually
>> a proxy to the "real" interpreter object; a dict lookup is necessary each time a
>> reference crosses the C/pypy boundary. Yes, this is slow.
>>
>> This is implemented in pypy/module/cpyext/pyobject.py; the main functions are
>> create_ref() and from_ref().
>>
>> --
>> Amaury Forgeot d'Arc
>>
>



More information about the Pypy-dev mailing list