lua-users home
lua-l archive

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

On Mon, Jul 21, 2014 at 11:27 AM, Coda Highland <> wrote:
> You could also allocate a tiny
> pointer-sized userdata and then use its __gc metamethod to free the
> original data block.

while that works and is very common, keep in mind that Lua will only
'see' very tiny objects; if you allocate a lot of big objects you can
consume a lot of memory and the Lua GC might not bother to collect
those 'tiny' objects.