lua-users home
lua-l archive

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


I have one application, where RAM is sparse (only 60kB RAM total in
microcontroller application) and I need large local string buffers in
the range of 5kByte inside some serial receiption loop, and in this
case I have to use <close> for these string butters in my inner loop.
(together with invoking garbage collector). At least if I remember
correctly. .. . Like this then all fine.

Without <close> I had big problems with this.

I agree with you, that such "automatic closing" easily CAN lead to
problems for more complex objects... . Maybe a warning in the
reference manual would make sense to warn against too extensive
usage... . (but I am sure the <close> inventors will NOT like this/
not do this :) )

Am Di., 3. Okt. 2023 um 09:28 Uhr schrieb kovserg33@gmail.com
<kovserg33@gmail.com>:
>
> To be close variable ( https://www.lua.org/manual/5.4/manual.html#3.3.8 ) in form it implemented is harmful by nature.
>
> They introduces unnecessary complexity. This implementation creates more problems than they solve.  It will lead to bugs on all levels. Even more this problems will be hard to find and debug.