[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Boxed userdata and garbage collector
- From: Peter Cawley <lua@...>
- Date: Thu, 2 Sep 2010 21:35:19 +0100
On Thu, Sep 2, 2010 at 9:30 PM, Ted Unangst <ted.unangst@gmail.com> wrote:
> On Thu, Sep 2, 2010 at 4:11 PM, Peter Cawley <lua@corsix.org> wrote:
>> The obvious solution to me is to allow the internally used allocator
>> to be changed, and allocate those megaoctects as userdata themselves
>> (with said userdata not actually being exposed to any Lua script, nor
>> having any fancy metatable).
>
> If the userdata is truly not exposed to Lua, it will be collected very
> quickly. The effects of this are quite undesirable. :)
Well obviously you have to put it somewhere, just not somewhere
visible. The registry or the environment of the enclosing userdata box
are obvious candidates.