Is it allowed to modify stack values as long as the stack stays balanced?

前端 未结 1 1088
北海茫月
北海茫月 2021-01-22 18:22

Everybody knows it is good programming practice to keep the stack balanced. What I\'m wondering, though, is whether I\'m allowed to modify stack values in a C function called fr

相关标签:
1条回答
  • 2021-01-22 18:47

    The stack values are the property of the C function being called. You can do whatever you wish with them. The only effect to the outside is the values returned by the function.

    C functions called from Lua do not need to keep the stack balanced, that is, with the same contents or number of items it had on entry.

    0 讨论(0)
提交回复
热议问题