lua-users home
lua-l archive

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


Hi,
On Wed, Sep 12, 2018 at 7:06 AM me the user <me.theuser@yahoo.com> wrote:

I was looking for ways to free up ram on embedded systems using lua and ran across e-lua
specifically the LuaTinyRam patches I looked through the source and replicated it on my side
to see what kind of ram savings it brought around 10-15k on this specific application pretty good!

Anyways, having hand applied the patches I realized how much of a maintenance nightmare
these changes would add, So I came up with something I think might work well and would like
to get some opinions.

My Idea is to use a form of late binding basically instead of luaL_register adding tables instead
it would store the address of the table and add an __index and __pairs method to the meta table
this is lua 5.1 so I also had to change the pairs function a bit

That looks like a nice idea, one that is much easier to implement and maintain. I am the author of the LTR patch and I fully agree that maintaining it between various versions of Lua is a nightmare, which is why I never tried to apply it to Lua 5.2 and above. Did you run some benchmarks to check how much memory your solution saves?

Thanks,
Bogdan