lua-users home
lua-l archive

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


> So I'm wondering whether we could keep them in flash instead of using scarce
> memory resources.

It should be feasible if you dump bytecode with struct headers, especially
for strings. You'll also need to add a DONTCOLLECT flag to everything that
might be collectable, like luaS_fix does.  The only issue I see is that
ROM bytecode might have strings that are already in the pool and you don't
want duplication of those. In that case, you'll need to free the copy in the
pool and point it to the copy in ROM. This would required changing the struct
that holds strings to explicitly store a pointer to the string data instead
of assuming it's in the tail of the struct itself.

I'd be very interested in seeing all this working. I'm willing to help if you
need any advice on bytecode format and the like.

This is actually the oldest item in my wish list. See
	http://lua-users.org/lists/lua-l/2007-09/msg00012.html
	http://lua-users.org/lists/lua-l/2001-07/msg00263.html

--lhf