[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Garbage collection vs. userdata
- From: "Javier Guerra" <javier@...>
- Date: Thu, 4 Dec 2008 08:47:42 -0500
On Thu, Dec 4, 2008 at 8:27 AM, "O. Wölfelschneider" <lua@teratronik.de> wrote:
> Can I somehow tell the garbage collector that new_fnord() allocates big
> time?
this is a frequent request. i'm sure lots of us would love to see it in Lua5.2
> Currently I'm calling collectgarbage("collect") every now and then, but this
> doesn't feel right.
the usual solution is to add a 'close' method to any userdata object
that holds an expensive non-lua resource, like open files, DB
connections, etc, and in your case, big chunks of RAM.
--
Javier