lua-users home
lua-l archive

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


>I have an application where i should be able to execute the
>pre-compiled chunks from flash.

You can load code fom memory with luaL_loadbuffer, but it does copy it into
Lua's internal data structures.

For some time now I have wanted to have a version of lundump.c that would
load code fom memory but avoid copying the heavy parts (strings and bytecode).
In principle, it would be easy to mark those parts as fixed, to be avoided by
the garbage collector. Unfortunately, strings are represented in Lua as a block
of memory that starts with internal data and ends with the actual strings. So,
I cannot see a simple way to reuse string data.
--lhf