From: matz@... (Yukihiro Matsumoto) Date: 2001-07-05T12:03:16+09:00 Subject: [ruby-talk:17267] Re: extension and GC HI, In message "[ruby-talk:17254] extension and GC" on 01/07/05, Shan-leung Maverick WOO writes: |I am writing an extension X in C. It creates a new class which inherits from |Hash. So in Init_X(), instead of passing rb_cObject to rb_define_class, I |used rb_cHash. I don't think I can answer properly withough looking your extension source. But in general, (1) override instance method "initialize", instead of overriding class method "new". (2) depends on when do you want to deallocate your memory, but global finalizer rb_set_end_proc() may help. See ext/curses.c matz.