[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Lua 5.0 Alpha and api_incr_top
- From: "Joshua Jensen" <jjensen@...>
- Date: Wed, 18 Sep 2002 08:54:26 -0600
>> In particular, why the shift away from the auto expanding stack?
>It is more in line with the way most other parts of Lua handle the
stack now. But please notice that you can increase the >stack size with
lua_checkstack.
That's all well and good, but it now requires me to know the size of the
stack the incoming Lua script uses, so I won't crash the application.
That's hard to determine when the data is either user generated or
dumped via an external tool. I don't know about you, but my primary
usage of Lua is data definition. Scripting follows close behind, but
data definition and accessing that data via C is top priority. This
turns my C code into a ticking time bomb.
I formally request the old behavior. There is no way I can determine
the size of the incoming data, especially when having to use recursion
in a C function to retrieve that data. If this becomes Lua's standard
behavior, I don't see how anyone can use Lua for arbitrary data
description, as it will crash (and does mine now) their applications if
their data size is indeterminate and they don't want to worry about all
sorts of special stack management tricks to access the data.
lua_checkstack() is an option if, and only if, you know the maximum size
of the stack (and it does not exceed 2048 entries... which is a huge
table, but I suppose it could be possible in a given application to
exceed that during recursion of the data). If you don't know the
maximum size of the stack, what are the options?
Thanks,
Josh