Learn and share
lua_pushvalue
[-0, +1, -]
void lua_pushvalue (lua_State *L, int index);
Pushes a copy of the element at the given valid index onto the stack
如上所述, lua_pushvalue(L, -4) 并不是往栈顶插入元素-4, 而是把在栈中位置为-4的元素copy之后插入于栈顶中!!!
posted on 2013-04-15 16:17 Nick Yang 阅读(6057) 评论(0) 收藏 举报