View Single Post
04-29-17, 12:39 AM   #1
SuperRookie
A Deviate Faerie Dragon
Join Date: Apr 2017
Posts: 11
What happens to the local variable (with in a file) that is not used at all.

Let's say I have to following code in a lua file

Lua Code:
  1. local varA
  2. local varB = 0
  3. local varC = "stringA"
  4.  
  5. local function funcA()
  6.     local varD
  7.     local varE = 1
  8.     local varF = "stringB"
  9. end

I know that varD to varF are removed from CPU when the funcA is terminated.

But, what happens to varA to varC and funcA?

Do they still stay in memory although they are not called or used, or collected by garbage collection at EOF?
  Reply With Quote