summaryrefslogtreecommitdiff
path: root/src/lua51/lobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua51/lobject.h')
-rw-r--r--src/lua51/lobject.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/lua51/lobject.h b/src/lua51/lobject.h
index 157fb37..ff63e2d 100644
--- a/src/lua51/lobject.h
+++ b/src/lua51/lobject.h
@@ -345,7 +345,7 @@ typedef struct CClosure {
struct Table *env //c 这个闭包的环境
*/
lua_CFunction f;
- TValue upvalue[1];
+ TValue upvalue[1]; // upvalue
} CClosure;
@@ -359,7 +359,7 @@ typedef struct LClosure {
struct Table *env //c 这个闭包的环境表,在luaF_newLclosure设置
*/
struct Proto *p; // lua闭包的函数原型
- UpVal *upvals[1]; // lua闭包的upvalue
+ UpVal *upvals[1]; // lua闭包的upvalue变长数组
} LClosure;
@@ -399,26 +399,26 @@ typedef struct Node {
//c 表
typedef struct Table {
CommonHeader;
- //c 标记这个表有哪些元方法,第一次查找时为0,如果有某个元方法,将对应位置为1
- //c 下次查找时就不需要查找字符串了
- //c flag会在luaH_set清空
+ // 标记这个表有哪些元方法,第一次查找时为0,如果有某个元方法,将对应位置为1
+ // 下次查找时就不需要查找字符串了
+ // flag会在luaH_set清空
lu_byte flags; /* 1<<p means tagmethod(p) is not present */
- //c lsizenode=log2(length of hash table) 由此可知散列表大小一定是2的幂
- //c 所以如果散列表要扩展,在原大小基础上扩展一倍
- //c 要得到散列表大小,只需要移位 length of hash table = 1 << lsizenode
+ // lsizenode=log2(length of hash table) 由此可知散列表大小一定是2的幂
+ // 所以如果散列表要扩展,在原大小基础上扩展一倍
+ // 要得到散列表大小,只需要移位 length of hash table = 1 << lsizenode
lu_byte lsizenode; /* log2 of size of `node' array */
- //c 该表的元表
+ // 该表的元表
struct Table *metatable;
- //c 数组部分
+ // 数组部分
TValue *array; /* array part */
- //c 散列桶起始位置
- //c 多个桶,桶内通过TKey->nk->next连接
+ // 散列桶起始位置
+ // 多个桶,桶内通过TKey->nk->next连接
Node *node;
- //c 空位置
+ // 空闲位置
Node *lastfree; /* any free position is before this position */
- //c 在global_State中有关gc的链表的下一个(如果这个对象被加入了的话)
+ // 在global_State中有关gc的链表的下一个(如果这个对象被加入了的话)
GCObject *gclist;
- //c 数组部分的大小
+ // 数组部分的大小
int sizearray; /* size of `array' array */
} Table;