lua-users home
lua-l archive

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

>From  Wed Jan 12 08:31:31 2000
>From: "Olivier Thirion de Briel" <>
>  I am a novice in LUA and I am trying to understand how the memory
>management works.

Like Roberto explained, Lua (not LUA!) has automatic memory management with
garbage collection, so you don't need to worry about it.
If you need, you can call collectgarbage (or lua_collectgarbage from C).

>  My aim is to reduce LUA size (ROM and RAM) for embedded LUA.

You may want to strip down lbuiltin.c and also only include those libraries
that you need (eg, probably not lmathlib.c). Also, for embedded systems, you'll
probably not need the parser. You can use only precompiled chunks.
See src/luac/README and src/luac/stubs.c.

BTW, because the FAQ does not seem to really have taken off, I'm planning to
start a series of Lua Technical Notes, in which specific points of the language
and the implementation would be explained and discussed.
The very first LTN will be about reducing the size of Lua in embedded systems!