summaryrefslogtreecommitdiff
path: root/src/lua51/lstring.c
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-09-27 20:31:53 +0800
committerchai <chaifix@163.com>2020-09-27 20:31:53 +0800
commit63cb4fbbb961da133c68865845eaf22d9b876700 (patch)
tree42be163db598df2cf1c11d329c3e5843db4faa0c /src/lua51/lstring.c
parent2dfa15a926f06137f2ba6afcce2e3c1d23300100 (diff)
*misc
Diffstat (limited to 'src/lua51/lstring.c')
-rw-r--r--src/lua51/lstring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua51/lstring.c b/src/lua51/lstring.c
index cadbb4b..acfd02f 100644
--- a/src/lua51/lstring.c
+++ b/src/lua51/lstring.c
@@ -63,7 +63,7 @@ static TString *newlstr (lua_State *L, const char *str, size_t l,
ts = cast(TString *, luaM_malloc(L, (l+1)*sizeof(char)+sizeof(TString)));
ts->tsv.len = l;
ts->tsv.hash = h;
- ts->tsv.marked = luaC_white(G(L));
+ ts->tsv.marked = luaC_white(G(L)); // 标记为当前白
ts->tsv.tt = LUA_TSTRING;
ts->tsv.reserved = 0;
@@ -119,8 +119,8 @@ Udata *luaS_newudata (lua_State *L, size_t s, Table *e) {
if (s > MAX_SIZET - sizeof(Udata))
luaM_toobig(L);
- // 创建并赋值
u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata)));
+
//c udata和普通对象在GC上的区别在于不调用luaC_link,因为不会加在
//c G(L)->rootgc链上,而是加在G(L)->mainthread后面
//c udata标记为 white