lua-users home
lua-l archive

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


Am Fr., 28. Juli 2023 um 19:38 Uhr schrieb Mouse <mouse@rodents-montreal.org>:
>
> >>> How does it handle alignments?  [...]
> the processor that's using the in-ROM data essentially doesn't have any
> alignment restrictions.

For String handling STM32 / ARM Cortex M4 (or M3/H7) will NOT have
alignment restrictions.

In case of any "calculation/math/memory storage variables" like Lua
numbers, integers, userdata, these MUST be aligned as I see it ... but
these keep in RAM as I see it?

Of course the Lua source code MUST be loaded in BINARY format /
precompiled form into ROM. Then my "dream" would be, that Lua during
"Lua command runtime" would use this ROM code directly from ROM,
whithout copying the ROM code to any "TString RAM data"... .

The "constant string data" in the Lua programs I think of should NOT
be necessary to keep in ROM ... except the binary Lua program... .
(which then obviously could be without problem be 100kB or 200kB
large, but RAM usage in range of 20-30kB no problem...).

(If there would be a Lua option, which would do the translation Lua
ascii program code to binary code "during runtime (e. g. line by
line...)" , then it should generally work in a "RAM saving way" to use
Lua ASCII program loaded in ROM... . But as I see it meanwhile, this
would somehow be much too cumbersome for Lua / for the parser... and
loading the Lua binary code into ROM is not a real issue for my
project at least, this could be accomplished without problems).