lua-users home
lua-l archive

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

Hi Rob,

Thanks for your quick reply. 

All of these variables which i am talking about has been defined as globals earlier on. So, i decided to change these variables as locals so that the lua space could be handled better. As soon as i change them to local everything falls apart. 

I would definitely put them in to a table and give it a try. Because i do have lot of tables. I would add this to a table as well. 

I thought there would be an another way to handle this, by adjusting the lua local space. 

Nevertheless, Just out of curiosity, do you know in which file these error constants has been defined and how these constants gets converted to the actual text. 


On Mon, Jun 15, 2009 at 10:46 AM, Rob Kendrick <> wrote:
On Mon, 15 Jun 2009 10:41:27 -0500
Sivan Thiruvengadam <> wrote:

> I am using LUA on Handheld Pocket PC based device. When i try to load
> a file which has around 500 local variables, the lua loadfile
> function throws the above error?

My understanding is that the Lua VM has a limited number of registers
(into which locals are placed), and the compiler has no mechanism to
spill excess elsewhere (in order to simplify the register allocator).
I may be hopelessly confused, however.

> Is there a fix already available and if so, please point me to that.
> And also if there is a better way to handle this please enlighten me.

Try putting them in a table instead?  They're surprisingly quick, just
not as quick, as locals.