lua-users home
lua-l archive

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


>I've been thinking about how to make Lua more rom-friendly.

I'm interested in this too.

>I turned the embedded bytecode generated by tolua from unsigned char[] to
>unsigned const char[]; this moves the bytecode arrays from initialized data
>into the text segment.

Nice tip! I've updated bin2c to reflect this.

>Since those bytecode arrays are going to stick around forever, it would be
>nice if as much of them as possible was used directly, rather than copying
>piecewise into heap.  I don't know how possible this is with the current VM
>design, but I could imagine functions just using a start/extent pointing
>into these blocks in this case.

I've thought about this but haven't found a good solution.
If *all* your bytecode arrays are static, then you may be able to change
lundump.c to reflect this. For strings, I think it's enough to set
ts->marked to FIXMARK. You'll have to change lgc.c to support FIXMARK for
other values.
--lhf