lua-users home
lua-l archive

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



On Fri, Jul 28, 2023 at 5:02 PM Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> > In
> > > eLua it's possible to use the compiled bytecode directly from flash
> > > [...]

How does it handle alignments? The arrays of opcodes inside a compiled
bytecode are not necessarily aligned (at least not in the standard format
that Lua uses to represent binary code).


eLua has a "ROM file system", which is basically a bunch of files and some metadata about their names arranged in a contiguous memory area. The alignment for the files can be controlled at compile time, when the ROMFS is created, so any bytecode file can be aligned in memory as needed. I think the current alignment is 8 bytes, but I'm pretty sure that 4 bytes also worked.
 
-- Roberto