GirFFI does not attempt to free any memory at the moment, or lower the reference count of any objects it gets from GObject. This task therefore involves two parts:
Free non-GObject pointers as needed (at garbage-collection time)
Lower reference count of GObjects (at garbage-collection time)
These in the order they occured to me, and may therefore be fixed in any order.
Create Type objects for all FFI types, including the ones currently represented by a single symbol, so we can always do stuff like
GirFFI::Types::UInt8.get_value_from_pointer(ptr)
rather than having awkward dynamic method dispatch inside GirFFI::InOutPointer.
Move code in GirFFI::Struct to StructBase, then somehow unify UnionBase and StructBase.
Move to a single Pointer class, rather than InPointer, InOutPointer and Pointer monkeypatching.
Move special types like SizedArray to sane namespaces. Types (like GLib::List) that have actual GLib implementations go to the GLib namespace. Other types go to the GirFFI namespace.
Use argumentbuilders to build signal argument marshalling functions.
GirFFI should make sure that if it gets a pointer to a GObject for which a Ruby object already exists, the existing object is returned. This involves the use of WeakRef, no doubt.
This is a big one. See commit 1e9822c7817062a9b853269b9418fd78782090b5 in gobject-introspection, and TestFundamentalObject in Regress.
The tests for TestFundamentalObject accidentally pass, but there may be hidden issues.
(11:37:03 PM) walters: the basic story is that GObject should be manually bound (11:47:02 PM) ebassi: the really necessary bits are: GObject/GInitiallyUnowned memory management; properties accessors; GSignal connection API (11:47:15 PM) ebassi: the rest is “nice to have” (11:47:37 PM) ebassi: oh, and probably GBinding - but that's just because I wrote it ;-)
GirFFI now generates loads of Something.wrap(ptr) calls; Perhaps these can be replace by implementing to_native and from_native in ClassBase and including FFI::DataConverter.
dnote