+
+ /* if tmp is a Ruby class, we'll just pass the arguments to the
+ * initialize method.
+ * if it's a c struct, we can use rb_class_new_instance()
+ */
+ if (rb_respond_to (klass, rb_intern ("raise"))) {
+ obj = rb_obj_alloc (klass);
+ rb_apply (obj, rb_intern ("initialize"), tmp);
+ } else
+ obj = rb_class_new_instance (1, &tmp, klass);