On Tue, Jan 27, 2015 at 5:35 PM, Darryl L. Pierce <dpie...@redhat.com>
wrote:

> On Fri, Jan 23, 2015 at 03:46:34PM -0500, Darryl L. Pierce wrote:
> > +1 Though, I was hoping we could avoid having to manually do things...
>
> So I have a working POC that assigns a Ruby object to a C struct in such
> a way as to keep the Ruby object from being reaped. The solution (for
> now) stores the object in a hidden global array for such objects for as
> long as they're held by the C structure and, when C is deleted or the
> reference changed, the object is removed from the array and available
> for reaping.
>
> I submitted a question to the Swig users mailing list, but that seems to
> be pretty low traffic and effectively unmanned ATM. Only 15 posts there
> in the last month and none of them have followups.
>

On the face of it this sounds like it could be quite brittle and probably
more complicated than just forgetting about swig for the one pn_rubyref_t
struct and wrapping it manually. Did you attempt the latter option at all?

It's really important to get this part right. If this isn't done well, then
the whole binding will be unstable. Whatever has been done here with the
current ruby bindings seems to seg fault about once every 10 test runs or
so. We really can't afford to repeat that.

--Rafael

Reply via email to