Lua 调用的 C 函数保存 state 的两种方式: Storing State in C Functions 笔记

http://yanbin.is-programmer.com/posts/94214.html

 

Registery的Key

1. 整数Key用于Lua的引用机制,所以不要使用整数作为Key

2. 通过lua_rawsetp将一个C指针包装成light userdata作为Key使用

3. 使用字符串作为Key

posted @ 2017-07-08 13:23  lilei9110  阅读(217)  评论(0编辑  收藏  举报