[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: 5.2 _ENV garbage collection question
- From: Peter Cawley <lua@...>
- Date: Mon, 27 Jun 2011 14:02:33 +0100
On Mon, Jun 27, 2011 at 1:57 PM, Gaspard Bucher <email@example.com> wrote:
> This means that the required script gets the original global _ENV even
> though _LOADED._G has been changed. It can also read the first "foo".
> It seems that removing _LOADED._G is not enough to purge "foo"...
That would be because when a chunk is loaded, it is assigned as its
environment the value require"debug".getregistry(). The environment
for your first chunk was from here, so unless changed, your second
chunk gets the same thing from here.