[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Garbage collection durint pcall.
- From: Francisco Olarte <folarte@...>
- Date: Sun, 2 Jun 2019 19:10:06 +0200
On Sun, Jun 2, 2019 at 4:21 PM Philippe Verdy <verdy_p@wanadoo.fr> wrote:
> It's another good case, because x is not used after print(x), it's no longer needed and a smart compiler can mark it as dead to reuse its slot in the current closure.
No, it cannot, as it is accesible and so not-dead according to the manual.
> It's the role of a compiler to track variable usages accesses in each scope, and discard unneeded variables or variables that are no longer accessed, in order to reduce the memory footprint and properly allocate as few slots as possible in each scope.
Also it's the role of the compiler to implement the language as
defined, no as it is more convenient for it.
Francisco Olarte.