lua-users home
lua-l archive

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

> I'm looking at writing some Lua programs for an embedded platform like eLua, and I have some questions about how Lua can perform in a "soft real-time" environment.  Lua appears to perform a lot of small dynamic memory allocations.  Is there a usable subset of the Lua language (not the libraries) that just uses the stack?

What do you mean by stack?

Anyway, Lua uses a memory allocator provided by the user. You can write one
that uses a fixed array as memory pool, if that helps. You can also use this
allocator to trace your memory needs.

Lua allocates memory especially when compiling your Lua programs.

Lua also allocates memory at runtime, for growing the Lua stack and other
internal structures, and also when creating strings (notably implicitly
when converting things to strings for output). Every function defined in
your Lua program needs memory when it's created. If your program does not
do much, then it won't need much memory after it's been compiled.

Perhaps it will help if you could tell us what kind of Lua programs you
intend to run.