From 51471ba74821d7caee9e4c9dd11faf70d614f533 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 15 Aug 2011 16:41:58 -0300 Subject: comments about use of 'luaH_set' --- lcode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lcode.c') diff --git a/lcode.c b/lcode.c index ff65279b..c11005c7 100644 --- a/lcode.c +++ b/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 ** 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 */ oldsize = f->sizek; 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)); luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants"); while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); -- cgit v1.2.3-55-g6feb