[Mono-dev] libffi

Charles Strahan charles.c.strahan at gmail.com
Mon Dec 13 19:08:46 EST 2010


Jon,

If I understand correctly, we'd have two options for using DLLImport:

  1.) Emit classes at runtime, containing the necessary native
function adorned with the DLLImport attribute.
  2.) Use DLLImport/PInvoke to provide access to
dlopen/LoadLibrary[Ex] and other similar functions, to dynamically
load DLLs and invoke their functions.

Is this correct? Option #1 seems relatively feasible, although we
would give up the ability to use our RubyFFI implementation where
Reflection.Emit is not available; Option #2 seems rather daunting.


Thanks,

-Charles

>On Thu, 2010-08-19 at 10:35 -0700, Ryan Riley wrote:
>> Has anyone created or investigated Mono support for libffi?
>
>Once upon a time, Mono used libffi directly.  It was removed in r724
>(git SHA1 ID d0cd6059c1b2edad12eb67cb8e64b3cd187be1b1) on 2001-09-05
>(and earlier).  Unfortunately, the commit message is useless, but iirc
>the reason for removing it was because it was significantly slower than
>what Mono could do itself.
>
>> I'd like to contribute this to help support Ruby-FFI for IronRuby.
>
>I imagine IronRuby doesn't require it's own FFI, it would just use the
>usual .NET FFI of DllImport, no?
>
>As for supporting Ruby-FFI, perhaps you can extend the existing Mono FFI
>support to support Ruby?  I don't know what would be involved...
>
> - Jon


More information about the Mono-devel-list mailing list