[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Execution of pre compiled lua code from memory mapped files
- From: Jay Carlson <nop@...>
- Date: Fri, 29 May 2015 11:01:53 -0400
On 2015-05-29, at 10:24 AM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
>
>> I'm confused. Although not part of the core library, luaL_loadbufferx()
>> exists, and is implemented in a very small amount of code:
>
> The point is that when Lua loads precompiled Lua code, it *copies* the
> data to its internal data structures.
>
> The question is about how to avoid this copy, especially in RAM
> starved systems, when precompiled code is already stored in ROM.
For people just joining in, check out http://www.eluaproject.net/doc/v0.9/en_arch_ltr.html for a discussion of what eLua does already.
I ran into the problem in my Lua-FLTK days (4.0, 2001?), where my tolua binding created one table per class for its methods. Not very memory-friendly, and the data structures were not sharable across Lua invocations the way C shared libraries can be.
Jay