From: Jason Roelofs Date: 2009-12-15T06:48:09+09:00 Subject: Re: Rice 1.3.0 - Now with full 1.9 support! --001636e0b6b965451c047ab70ab2 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Dec 14, 2009 at 3:49 PM, Matt Bleh wrote: > Great news! =) > (I'm the one who was bugging you about using RB++/Rice for wrapping GSL, > remember?) > > Just a question, how does rice/rb++ handle memory in the GC? I mean, > does it have a one-to-one mapping between wrapped C pointers and > objects? Or will it create a new wrapped object (i.e: different > object_id) every time a to_ruby conversion from a wrapped C++ class is > performed? > I'm asking this since for my project (not the one with GSL, a 3D+physics > simulator which is currently wrapped to ruby with SWIG) it may be an > issue if on every timeframe objects are created and destroyed. > > Matt > -- > Posted via http://www.ruby-forum.com/. > > AFAIK Rice does a pretty good job of managing object pointers and not causing an excessive amount of memory thrashing by creating / destroying C++ and Ruby objects, but I've never run any real memory tests against it. I do know that with my project of wrapping Ogre 3D I have to GC.disable or I get crashes where memory gets freed before it should (related more to my wrapping code than Rice itself, I do believe), so there's plenty of work to do with this before it's rock solid both itself and how people are to use it. One thing Rice doesn't have that I have been asked about is SWIG's %trackobject directive: http://www.swig.org/Doc1.3/Ruby.html#Ruby_nn60. My plan right now is to let the current features get beat on, and for now spend time on memory management and some work underneath the covers. If you find some reproducible memory problems do please create an Issue for it, or a discussion on the ruby-rice mailing list. Jason --001636e0b6b965451c047ab70ab2--