[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Boxed userdata and garbage collector
- From: Sylvain Fabre <sylvain.fabre@...>
- Date: Thu, 02 Sep 2010 22:23:09 +0200
Thanks for the idea, i will try it !
The point i just want to check is that the use of lua_newuserdata is not
too slow compared to usual "malloc-type" allocators.
Le 02/09/2010 22:11, Peter Cawley a écrit :
On Thu, Sep 2, 2010 at 9:03 PM, Sylvain Fabre<email@example.com> wrote:
Yes of course :) All our objects have a __gc metamethod implemented !
But the core issue is that for each object allocated internally, onlye 4
bytes/8bytes are seen from the LUA garbage collector... But internally,
megaoctets are allocated...
Hence, the garbage collector does not trigger "properly", and we ran out of
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).
Fixe: 09 72 11 30 24
Mobile: 06 30 12 72 34
Fax : 09 72 11 10 71