From: "Iñaki Baz Castillo" Date: 2009-10-25T00:32:43+09:00 Subject: Re: C extension: "malloc" and "rb_raise" El Sábado, 24 de Octubre de 2009, Bertram Scharpf escribió: > Hi, > > Am Samstag, 24. Okt 2009, 08:55:11 +0900 schrieb Iñaki Baz Castillo: > > El Sábado, 24 de Octubre de 2009, Yukihiro Matsumoto escribió: > > > In message "Re: C extension: "malloc" and "rb_raise"" > > > > > > on Sat, 24 Oct 2009 08:43:32 +0900, Iñaki Baz Castillo writes: > > > |Perhaps Ruby havs a garbage collector for C? > > > > > > Ruby GC only handles Ruby objects and memory regions pointed by them. > > > > Thanks for clarify it. So I must use free() before rb_raise(). > > It's surely a matter of taste but I think you should not. Mixing > different allocation methods in one C source file will detain you > from understanding your own code just one month later. It's a small piece of C code, no more. Do you mean that I shouldn't use "malloc"/"free" in a Ruby C extension? Regards. -- Iñaki Baz Castillo