From: matz@... (Yukihiro Matsumoto) Date: 2003-07-04T16:25:21+09:00 Subject: Re: rb_gc_mark(): unknown data type...non object Hi, In message "Re: rb_gc_mark(): unknown data type...non object" on 03/07/04, Jim Cain writes: |In the meantime, I was reading some previous posts about rb_obj_alloc |"only working for T_OBJECT classes" in 1.6.x. Just what exactly are |T_OBJECT classes? Non-builtin classes? I wasn't sure just what was meant |by that, and I do use rb_obj_alloc in a few cases, so out of curiosity I |built my extension on 1.8, and now I don't get the gc "unknown data |type" error. At least not yet. Maybe just a coincidence. We'll see. Each object has its "type". "type" is not a class. It describes the structure that object has. For example an object with T_OBJECT type is implemented by "struct RObject". In 1.6.8, classes does not have information about the type of its instances, so that rb_obj_alloc() produces T_OBJECT object, no matter what type it should be. In 1.8.0 each type knows its instance type, so that rb_obj_alloc() work fine with all classes. But you have to define allocation function using new rb_define_alloc_func() API. matz.