[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Yet another proposal for <toclose> (was Re: [ANN] Lua 5.4.0 (alpha) now available)
- From: Sergey Kovalev <kovserg33@...>
- Date: Sun, 30 Jun 2019 00:07:55 +0300
> Since function definitions allocate memory and thus can fail, this idiom
> isn't safe. You'd have to use the more awkward
I see no practical reason too be correct in all possible and
impossible situation.
There is no language and no os that correctly work in case of no resource.
The only solution is to pre allocate resource for code that will kill
innocence to release resources to other.
In case of limited resources you will do only limited amount of work.
You should has tools to measure resources used by program to predict
requirements. Or at least measure typical requirements for typical
tasks.
> And then you realize that Lua may allocate memory during function
> *calls* (e.g. growing the stack). I don't think this is covered in the
> current <toclose> approach either.
Lua has stack reserve for emergency, hasn't it?