lua-users home
lua-l archive

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


On Thu, Apr 12, 2018 at 12:41 PM, Viacheslav Usov <via.usov@gmail.com> wrote:
> about deterministic collection/finalization. The principal issue is that
> some userdata are much more than a handful of bytes, they can be handles,
> connections, money and what not.

This is the important point. I first encountered this issue when doing
Lua on top of Java in Android - the userdata could contain really big
objects like images, but the Lua GC had no way of knowing this. A GC
on top of a GC! I recall that Eric Wing had similar issues with his
ObjectiveC/Lua bridge.

Although, at least on Android there is a lot of explicit resource
dropping, because there's not that much memory to wait for the GC to
do its (slow) magic.

I must say I like the idea of deterministic resource finalization,
although I understand it has runtime implications.