Re: Generic CClosure marshaller using libffi



Johan Dahlin <jdahlin async com br> writes:

> Attached is a patch that adds a generic cclosure marshaller using libffi to
> gobject. The reason for this is to allow signals of GObjects written in a
> language binding to call signal callbacks in C.
> It's not just a theoretical case, Edward Hervey recently ran into this
> problem while trying to prototype a GStreamer element in Python.
> 
> It has conditional support, perhaps it would be better to required a copy of
> libffi, but since there are no official releases since 1998 so you'd have to
> use the CVS version.

One thing that could be considered is to just add a libffi type API to
Glib. It's generally useful and people who need it always end up
cutting and pasting libffi or using various other ad hoc hacks.

Doing this would require a bit of assembly for every platform GLib is
used on, but code for most popular architectures can be cutted and
pasted from libffi. The code for x86 and x86-64 would probably have to
be translated into Intel syntax to make it work on non-gcc Windows.

I don't know if it is worth doing; there are both pros and cons.


Soren



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]