lua-users home
lua-l archive

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


> Le 25 juin 2016 à 17:47, Patrick Donnelly <batrick@batbytes.com> a écrit :
> 
> On Fri, Jun 24, 2016 at 6:45 PM, Javier Guerra Giraldez
> <javier@guerrag.com> wrote:
>> (i'm quite rusty with pcall(), but i think the intention is clear...)
>> of course, it would be a _lot_ better to avoid the function creation,
>> and instead have some language support to hook resource release
>> directly to scope exit:
>> 
>>    do
>>        local f = open(...)
>>        onexit do f:close() end
>>        .... do things with f ....
>>    end
> 
> For other readers, this has also been extensively discussed in this
> thread [1]. In particular, see Roberto's proposal [2].
> 
> [1] http://lua-users.org/lists/lua-l/2015-11/msg00152.html
> [2] http://lua-users.org/lists/lua-l/2015-11/msg00303.html

Although interesting, his is unrelated with the original subject of this discussion, that was about discussing possible ways of improving the current GC algorithm in Lua, by releasing values sooner when some locality conditions are satisfied (and not about releasing costly resources in a deterministic way).

Could we come back to the original subject? Thanks. :-)

Jean-Luc