recently, when reading an elevation book and describing the method of mark removal for garbage collection, there are several points that I don"t understand. The original text is as follows
the garbage collector marks all variables stored in memory at run time. It then removes the variables in the environment and the tags of the variables referenced by the variables in the environment. Variables that are tagged after that will be treated as variables to be deleted because variables in the environment can no longer be accessed.
I would like to ask: which environment does the environment refer to in this article?
the following is my understanding. I don"t know where there is a mistake. Please point out:
environment if it is the local environment in the function, then it will remove the variables in the environment and the tag of the variables referenced by the variables in the environment. Not all the local variables have been removed and will not be clear. So this is not a local environment.
Environment if it is a global environment, what does it mean by a variable referenced by a variable in the environment?