[pypy-dev] clarification cffi vs _ffi_ vs _ffi vs libffi vs _rawffi vs rffi

Amaury Forgeot d'Arc amauryfa at gmail.com
Tue Dec 3 16:57:14 CET 2013


2013/12/2 Ryan Gonzalez <rymg19 at gmail.com>

> Check the _tkinter and _sqlite3 modules.
>

But they don't do advanced reference management, even if
_tkinter/tclobj.py has some calls to Tcl_IncrRefCount()
and Tcl_DecrRefCount().

The lxml module has interesting code to manage cross-references between C
and Python.
I'm afraid it's a bit difficult to read (it's an almost exact port of the
cython version)
But I found that ffi.new_handle() and ffi.from_handle() are really handy in
this case:
https://github.com/amauryfa/lxml/blob/cffi/src/lxml-cffi/proxy.py#L20



> On Mon, Dec 2, 2013 at 1:29 PM, Dima Tisnek <dimaqq at gmail.com> wrote:
>
>> Thanks, Armin, doc page looks good now!
>>
>> On a related note, I'm thinking to interface jvm/dalvik, similar to
>> jpype (C module) and following pyjnius (cython module), but in cffi.
>>
>> I'd be very grateful if there was a good pypy/cffi project you could
>> point me to as an example, especially of harder bits like reference
>> management.
>>
>> d.
>>
>> On 27 November 2013 18:08, Armin Rigo <arigo at tunes.org> wrote:
>> > Re-Hi,
>> >
>> > On Wed, Nov 27, 2013 at 5:24 PM, Armin Rigo <arigo at tunes.org> wrote:
>> >>> http://doc.pypy.org/en/latest/extending.html
>> >
>> > I updated that page.
>> >
>> >
>> > Armin
>> _______________________________________________
>> pypy-dev mailing list
>> pypy-dev at python.org
>> https://mail.python.org/mailman/listinfo/pypy-dev
>>
>
>
>
> --
> Ryan
> When your hammer is C++, everything begins to look like a thumb.
>
> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> https://mail.python.org/mailman/listinfo/pypy-dev
>
>


-- 
Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20131203/acc07aa7/attachment.html>


More information about the pypy-dev mailing list