Subject:
Re: [ruby-ffi] Re: freeing memory after FFI::MemoryPointer.new
From:
Alvaro
Date:
1/5/11 11:38 AM
To:
ruby-ffi@googlegroups.com

2011/1/5 Chuck Remes <cremes.devlist@mac.com>:
>
> On Jan 5, 2011, at 7:51 AM, Alvaro wrote:
>
>> I understand your point about how it works the garbage collection.
>> Is a kind strange that the C lib purely don't have leaks but with the
>> FFI binding it has and I couldn't find the reason yet, may be is
>> inherited to ruby, I've tested it with Ree, Mri and JRuby without
>> success.
>>
>> I will continue trying to figure out what is happening, thanks for
>> your comments.
>
> Is this code public and available online somewhere? If so, someone on this list may get curious and look at it too.
>
> It's possible, though unlikely, that the leak is in the FFI library. I had some massive leaks in a library I wrote using FFI, but I tracked 100% of them back to my own errors. There are now 0 leaks in the code (though I did find a few minor ones in each Ruby runtime).
>
> cr
>
>

The code is not public available, but I am pasting it here:
http://pastie.org/private/lj5wqnlxdxwbe6ghjlpg

-- Alvaro