mirror of https://github.com/rusefi/lua.git
comments about use of 'luaH_set'
This commit is contained in:
parent
0b65cb74cd
commit
51471ba748
4
lcode.c
4
lcode.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lcode.c,v 2.57 2011/07/15 12:50:29 roberto Exp roberto $
|
** $Id: lcode.c,v 2.58 2011/07/27 18:07:37 roberto Exp roberto $
|
||||||
** Code generator for Lua
|
** Code generator for Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -304,6 +304,8 @@ static int addk (FuncState *fs, TValue *key, TValue *v) {
|
||||||
/* constant not found; create a new entry */
|
/* constant not found; create a new entry */
|
||||||
oldsize = f->sizek;
|
oldsize = f->sizek;
|
||||||
k = fs->nk;
|
k = fs->nk;
|
||||||
|
/* numerical value does not need GC barrier;
|
||||||
|
table has no metatable, so it does not need to invalidate cache */
|
||||||
setnvalue(idx, cast_num(k));
|
setnvalue(idx, cast_num(k));
|
||||||
luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants");
|
luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants");
|
||||||
while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);
|
while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);
|
||||||
|
|
4
llex.c
4
llex.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: llex.c,v 2.56 2011/08/09 20:58:29 roberto Exp roberto $
|
** $Id: llex.c,v 2.57 2011/08/11 17:06:12 roberto Exp roberto $
|
||||||
** Lexical Analyzer
|
** Lexical Analyzer
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -128,6 +128,8 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
|
||||||
setsvalue2s(L, L->top++, ts); /* temporarily anchor it in stack */
|
setsvalue2s(L, L->top++, ts); /* temporarily anchor it in stack */
|
||||||
o = luaH_set(L, ls->fs->h, L->top - 1);
|
o = luaH_set(L, ls->fs->h, L->top - 1);
|
||||||
if (ttisnil(o)) { /* not in use yet? (see 'addK') */
|
if (ttisnil(o)) { /* not in use yet? (see 'addK') */
|
||||||
|
/* boolean value does not need GC barrier;
|
||||||
|
table has no metatable, so it does not need to invalidate cache */
|
||||||
setbvalue(o, 1); /* t[string] = true */
|
setbvalue(o, 1); /* t[string] = true */
|
||||||
luaC_checkGC(L);
|
luaC_checkGC(L);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue