[gambit-list] Copying arrays C<->Scheme

Álvaro Castro-Castilla alvaro.castro.castilla at gmail.com
Fri Apr 12 06:07:47 EDT 2013


There is one thing that I've been meaning to ask for a long time now.

I see most of the people tend to create arrays in C by malloc/___alloc_rc
and then assigning values by iterating over them via a setter function
(also defined with c-lambda).
Isn't there a way to directly do this with a memcpy operation? Wouldn't
that be faster?

I understand that Gambit's heap and C's heap are separate, and you need to
copy from one another in order to avoid GC touching any of FFI-created
memory. But is it possible to improve this process using some sort of C
function/macro from Gambit?

I really can't find any code examples or reference for this.

Thank you very much.

Álvaro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20130412/539259f0/attachment.htm>


More information about the Gambit-list mailing list