lua-users home
lua-l archive

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


Hi Luiz,

Thanks a lot for the helpful comments. I'm now down to 25K of code, after leaving out the standard libraries and the parser (using noparser.c). I didn't do any other modifications to the LUA code yet and I still have to do some testing.

Bert


Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> - we don't want to support the lua standard libraries

Just don't open them.

> - we don't support dynamic memory allocation and leave out the garbage collector (so we need a special keyword to alloc all memory at boot time)

Use your own memory allocator that gets memory from a fixed pool allocated
the first time it is called.

To avoid the garbage collector, you can write stubs for the functions exported
in lgc.h.

> - we use int32 instead of float as number type

Edit luaconf.h

> - we don't support the local keyword or variables that were not explicitly allocated at boot time

Edit llex.c and add a space before "local" in luaX_tokens. But that will
put all variables as global variables, which probably use more memory
than local variables...

To forbid creating global variables after boot time, set up a __newindex
metamethod for _G to raise an error.

> what parts of the LUA source distribution would I need to run the VM on the ARM and what can I leave out?

Try leaving out the parser modules by using etc/noparser.c.
--lhf


How low will we go? Check out Yahoo! Messenger?s low PC-to-Phone call rates.