This patch implements the infamous
SWIG_RubyInstanceFor() described at the end of the Ruby
documentation. For details on how it works see
The quick summary:
* Add support for SWIG to automatically track the
mappings between Ruby objects and C++ objects. This is
needed to implement "mark" functions for Ruby's garbage
* Implements the SWIG_RubyInstanceFor described in the
* The mappings are stored using Ruby's built in C hash
tables (note the Perl module also uses a hash table to
track mappings from Perl objects to C++ objects.
* Tracking mappings introduces a slight performance hit
of 2 or 3 percent (see link above).
* By default this feature is *off*. To enable it you
must compile your Ruby SWIG bindings by define the
preprocessor item SWIG_RUBY_OBJECT_TRACKING.
* Enforces the rule that only one Ruby object wraps the
same C++ object. currently, multiple Ruby objects can
wrap the same C++ object
* Provides updated documentation.
* patches for ruby.cxx, ruby.swg, rubydef.swg
* new file called rubytracking.swg (goes into lib/ruby
* updated documenation - this should replace section
27.9.4 (assuming patch 1272995 has been applied first).
Log in to post a comment.