From: Michal 'hramrach' Suchanek Date: 2003-05-21T21:19:46+09:00 Subject: Re: ruby garbage collection On Tue, May 20, 2003 at 07:32:02PM +0900, Simon Strandgaard wrote: > On Tue, 20 May 2003 16:39:37 +0900, Mauricio Fern�ndez wrote: > > > On Tue, May 20, 2003 at 07:28:41AM +0900, Simon Strandgaard wrote: > >> > > >> > Should extension writers overload new so that ruby_xmalloc/ALLOC > >> > is being used ? any benefits ? > >> > > >> > Or should we just stick with new/delete ? > > A) > > If you use ALLOC and the (de)allocation pattern of your extension will > > make Ruby GC work when it should (and regain some memory), use it. Since the memory may be freed outside your extension it can make it work in some cases when plain malloc would fail because of garbage-filled memory. At least it is how I understand the purpose of ALLOC. -- Michal Suchanek hramrach@centrum.cz