Lua has static and dynamic variables in the heap?

Asked

Viewed 116 times

0

Does the storage binding (related to the variable’s lifetime) allow static variables? Allows dynamic variables of heap?

1 answer

2


There are some definitions of what would be static variable. Lua has no static variable mechanism, but is powerful and flexible to get the same result through other mechanisms.

By default values are placed on heap through dynamic allocation and variables can point to these values. You use local to switch to automatic allocation in stack.

  • Thanks for your help!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.