From: Markus Date: 2004-10-27T00:31:21+09:00 Subject: Re: How to bind a graph structure? On Tue, 2004-10-26 at 02:14, Erwan Loisant wrote: > What could be a better design? I there a way to design my C library > better so I can tell Ruby's garbage collector about references without > introducing a Ruby dependency in my library's source code ? I'm not sure that this is logically possible to do in a clean way. You may be able to find a way to do it with no _explicit_ dependencies on Ruby in your source code (though I don't see how), but only by introducing some _implicit_ dependencies, e.g. relying on side effects of the interaction between your code & ruby's to do what you want. This would be very brittle. One idea might be to give ruby "handles" of some sort that were only usable/meaningful via calls to your library. As far as ruby's GC was concerned, they would just be integers. You would then be able to manage your storage as you saw fit, and ruby would be able to do likewise. -- Markus