[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Freeing resources associated with a user-supplied allocator
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 15 Mar 2006 14:15:09 -0300
> One apparently missing feature in Lua's user-supplied allocator support
> is a way for the allocator to be notified when it's already needed, so
> it can free associated resources.
The standard way to free any host resources at Lua close time is to add
an entry in the registry. This entry sets a userdata with the appropiate
gc method, which will only be called when the registry is freed, ie, when
Lua closes. (If your application replaces the registry, you'll have to
recreate the entry there.)