lua-users home
lua-l archive

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


Hi,

Last time I looked at the source code, Lua didn't really have a concept of "ROMability", in the sense that you can't save data structures in ROM/flash and use them directly from there (without having to load then into RAM). In eLua it's possible to use the compiled bytecode directly from flash and there's also a "read-only string" type that keeps the *content* of the string in flash (just the content, not the whole TString data structure) and uses it from there. But all these require changes to the Lua source code.

Best,
Bogdan

On Wed, Jul 26, 2023 at 1:54 PM bil til <biltil52@gmail.com> wrote:
Am Mi., 26. Juli 2023 um 12:37 Uhr schrieb 云风 Cloud Wu <cloudwu@gmail.com>:
> Using a pointer in the struct TString to refer the string memory, so
> that the constant strings in the precompiled binary code can be put into ROM.

Thank you for fast answer... .

Just I would hope to come around doing such quite basic things to Lua code... .

So you think, that after loading a Lua code file, the complete
pre-compiled code is saved to some string object / or several string
objects?

... just then obviously I any way have only some possibility to come
around "extensive RAM usage for larger Lua files", if I use
precompiled Lua code?