From: Yukihiro Matsumoto Date: 2009-10-25T02:28:52+09:00 Subject: Re: C extension: "malloc" and "rb_raise" Hi, In message "Re: C extension: "malloc" and "rb_raise"" on Sun, 25 Oct 2009 02:06:42 +0900, Tim Hunter writes: |Also check out Ruby's xmalloc and xfree. These functions act |like malloc and free but the memory will be garbage collected when Ruby |determines that there are no more references to it. Unfortunately, regions allocated by xmalloc() will not be garbage collected. You still need to deallocate them by xfree(). The difference is that garbage collector will be kicked when a) underlying malloc() failed, b) certain amount of memory region is allocated, to make more free space. matz.