From: nobu.nokada@... Date: 2002-01-24T09:08:10+09:00 Subject: Re: xcalloc counterpart Hi, At Thu, 24 Jan 2002 08:15:09 +0900, ahoward@fsl.noaa.gov (ara howard) wrote: > I'm digging into a ruby ext i've downloaded (sysvipc from raa) and > have fixed a few bugs in it with help from this group (thx all). > Currently i'm looking into memory management for ruby exts and > wondering what the relationship is between the various > XXXmalloc/XXXcalloc etc. calls. Specifically the ext i'm looking at > has xcalloc's all over the place with no kind of frees anywhere? This > doesn't feel right and i'm hoping that xcalloc registers with the gc > somehow? If not this ext will leak like a sieve. I'm digging into > the ruby source but haven't found what i'm looking for yet... # What ext are you looking? Subjects of ruby GC are VALUEs only. Just xmalloc()ed memory will never be freed. You need to xfree(). Or, make VALUE with Data_(Wrap|Make)_Struct(). Thus GC `free's the memory with the specified function. -- Nobu Nakada