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

On Mon, Dec 21, 2009 at 8:40 PM, rogerdpack <rogerpack2005@gmail.com> wrote:
>> 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?
>
> Which reminds me of dl's #malloc method.
>
> 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?
>

Daniel Berger of win32utils project is migrating windows-pr and
related tools to use FFI.

AFAIk Win32API implementation running over DL was never working as
expected. Please take a look to Park Heesob rudimentary implementation
using DL in rb-readline.

DL and Win32API "API" are limited and more C-like than FFI, perhaps a
wrapper can be build, but I would suggest talk with win32utils team to
avoid overlapping work.

Wonder how JRuby is doing that?

-- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exupéry