[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lua Compile/one time Load?
- From: Keith Cancel <admin@...>
- Date: Wed, 18 Oct 2023 11:36:26 -0700
Hello,
I was looking at the source code trying to see if there was a way
maybe to achieve something similar to lua_load(), but at compile time.
Basically, I want to bunch a shared code to only occupy the memory
once instead of creating copies for each new lua VM instance. I
basically just want that code in ROM that can be executed by each new
instance without having to copy it over first.
While I am not super familiar with the Lua internals. Looking at the
source code I did not see any obvious or easy methods to achieve that
if I were to patch the code. Is that assessment correct or am I
missing something? It looks like the chunk is pushed on the stack.
Does the stack need to be contiguous or can it be linked from
different sections of memory like a linked list?
Thanks,
Keith