Subject:
Re: [ruby-ffi] Re: Struct/ManagedStruct and GC behaviour
From:
Wayne Meissner
Date:
12/21/09 5:47 PM
To:
ruby-ffi@googlegroups.com

2009/12/22 rogerdpack <rogerpack2005@gmail.com>:
>> I should have added a footnote that just because it *can* be
>> collected, there is in fact no guarantee that objects are in fact ever
>> collected by the GC.  Depending on the implementation, there might not
>> be sufficient ruby/java memory pressure to cause a GC event, so the
>> objects are not collected, and the native memory is never freed.
>
> Is there a #destroy method?

There is a #free method on both AutoPointer and MemoryPointer to
explicitly free them.


> Also a question.
> In the old dl world there was dl/win32 which was a dl implementation
> of Win32API.  Would there be any interest in seeing an FFI port of the
> same?

You mean, like this?
http://kenai.com/projects/jruby/sources/main/content/lib/ruby/1.8/Win32API.rb?rev=498a8743a12ed64e3fa6f994318caf62dfa73aa5