[gambit-list] Problem with FFI & Memory Corruption

Taylor Venable taylor at metasyntax.net
Mon Feb 13 23:27:27 EST 2012


On Fri, Feb 10, 2012 at 14:09, Marc Feeley <feeley at iro.umontreal.ca> wrote:
> I'm glad you found the bug.  I looked at your code yesterday and all the allocations seem correct (use of ___STILL objects, and appropriate reference count management).  It seems I missed the "out of bound" index which was the problem.

Thanks for the review! Do you think it would be a good idea to update
the wiki with some documentation about using the C macros/functions
like ___TRU, ___FAL, ___FIX, ___make_pair, ___make_vector,
___release_scmobj, etc. so that others can have an easier time
building more complicated FFI code? I'd be happy to do it. These seem
to be fairly lightly documented in the manual. The method of turning
vectors into structures is especially useful, but I only found out
about it by reading lib/os.c

Best regards,

-- 
Taylor C. Venable
http://metasyntax.net/



More information about the Gambit-list mailing list