FFI::Struct or FFI::ManagedStrict ?
kojix2 opened this issue · 1 comments
kojix2 commented
FFI::Struct seems to need to be released explicitly after allocating memory. On the other hand, FFI::ManagedStruct seems to be able to register functions necessary for memory release.
Should I use ManagedStruct?
kojix2 commented
ManagedStruct is implemented in Ruby, not C. When the GC retrieves the object, it calls a function that releases the memory. This works very well. For now, I think we should use ManagedStruct if possible.
However, since it is not a high priority, I think it is okay to implement it occasionally when memory usage is a concern.