[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What happens when loading
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 11 Jul 2014 23:25:05 -0300
> 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.
load (and friends) just does that: loads the chunk and compiles it
into a function. If you don't save or use the result, it'll be garbage
collected.
> question is where is the function stored?
It is stored where you tell Lua to. If you use it immediately, it'll be
stored temporarily in a VM register and eventually be collected.