lua-users home
lua-l archive

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

Bogdan Marinescu wrote:

As part of my "Lua for microcontrollers" project (, I'm trying to reduce the memory footprint needed by Lua. With all the eLua auxiliary modules enabled, "print(collectgarbage'count')" reports about 25k right after the Lua interpreter starts - quite a bit for a micro than can only access 64k of RAM. So I'm looking for ways to reduce this.

I'm interested in this also :-) My Lua loads the base, string, table,
and debug libraries, as well as a fairly large library of functions
that are specific to the application.

I was thinking that it would be a good idea to have a way to
make some of these tables "constant" or read only.

We'd have to come up with some way of defining the tables
at compile time, with the obvious disadvantage of not being
able to modify them later.

I'll have to take a look at the table definintion code to see
if there's a way to macro-ize the results of the library init

But I'm open to any ideas in this regard, and my initial
guess at how to do it is probably misguided...