lua-users home
lua-l archive

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

As I understand it when you load a file or string you compile the chunk into a function which is then called to evaluate the code in the chunk. My question is where is the function stored? Is it somewhere in the lua state or is it just somewhere in memory and calling the function adds the code to the state? And what happens if I don't call the function and lose the reference will it then go away, or will it remain in memory? What if I load a chunk, then do a collectgarbage will it still be there or will it have disappeared? Etc, I think you get the idea.

So when are things done to get the chunk into the system?