lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Dec 01, 2006 at 10:30:32PM -0500, Diego Nehab wrote:
> Hi,
> 
> I forget what is the standard solution to make Lua's GC
> aware of the external cost of a "userdata" value. Sometimes
> you have a userdata representing, say, an image. But the
> image itself takes more room than the userdata because it
> was allocated outside of Lua (sometimes you can't change
> that). So Lua might not feel like collecting the userdata
> eventhough it represents a lot of memory and is not
> referenced anymore.
> 
> Can anyone refresh my memory?

__gc

-- 
Glenn Maynard