summaryrefslogtreecommitdiff
path: root/src/lua51/lobject.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-09-09 20:09:27 +0800
committerchai <chaifix@163.com>2020-09-09 20:09:27 +0800
commit229a3937a3b99a175b551e28d09b9a45d37c44f7 (patch)
tree3dce1ff5cbb81fe9d6a774c77878a48146ead8d0 /src/lua51/lobject.h
parent77ac95b9985f5669d6659bfb54728786d28c2ef0 (diff)
*misc
Diffstat (limited to 'src/lua51/lobject.h')
-rw-r--r--src/lua51/lobject.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lua51/lobject.h b/src/lua51/lobject.h
index af6b63a..25dc341 100644
--- a/src/lua51/lobject.h
+++ b/src/lua51/lobject.h
@@ -244,13 +244,14 @@ typedef struct Proto {
TValue *k; /* constants used by the function */
//c 函数字节码
Instruction *code;
+ //c 内部函数
struct Proto **p; /* functions defined inside the function */
int *lineinfo; /* map from opcodes to source lines */
//c 局部变量
struct LocVar *locvars; /* information about local variables */
//c upvalue
TString **upvalues; /* upvalue names */
- TString *source;
+ TString *source; //文件名
int sizeupvalues;
int sizek; /* size of `k' */
int sizecode;
@@ -285,7 +286,7 @@ typedef struct LocVar {
/*
** Upvalues
*/
-
+// 判断upvalue是关闭的方式是 uv->v == &uv->u.value
typedef struct UpVal {
CommonHeader;
TValue *v; /* points to stack or to its own value */
@@ -316,8 +317,8 @@ typedef struct CClosure {
typedef struct LClosure {
ClosureHeader;
- struct Proto *p;
- UpVal *upvals[1];
+ struct Proto *p; // lua闭包的函数原型
+ UpVal *upvals[1]; // lua闭包的upvalue
} LClosure;