[erlang-questions] FFI for Erlang: patches and draft EEP

Vlad Dumitrescu vladdu55@REDACTED
Tue Sep 11 15:14:47 CEST 2007


On 9/11/07, Claes Wikstrom <klacke@REDACTED> wrote:
>
> Alceste Scalas wrote:
> > Hello,
> >
> > some time ago [1] I asked for comments about extending Erlang/OTP with a
> > Foreign Function Interface (FFI) --- i.e. some new BIFs for calling
> > external C code, with automatic Erlang/C type translations.  The
> > response was pretty good.
> >
>
> Nice work  - two questions.
>
> call erlang--> C and binary() data: Is the binary data copied
> or does the C function get a pointer/size pair - the latter
> would be optimal.
>
> return C --> erlang - I can't seem to find any ways for the
> C code to return a binary() back to erlang ?? This is IMHO
> necessary
>
> :-) You beat me to it!

If the C side uses pointers to the internals of the Erlang binaries, aren't
there going to be some nasty interactions with the garbage collector?

regards,
/Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070911/7b7bd8ab/attachment.htm>


More information about the erlang-questions mailing list