From 8634b2a0119e698e362fdb765f30258e79e1dfd0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sun, 30 Apr 2017 17:43:26 -0300 Subject: added 'cachemiss' field to prototype to avoid wasting time checking hits that fail too often --- lgc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lgc.c') diff --git a/lgc.c b/lgc.c index 692326f3..65f4909c 100644 --- a/lgc.c +++ b/lgc.c @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 2.225 2017/04/24 16:59:26 roberto Exp $ +** $Id: lgc.c,v 2.226 2017/04/24 17:52:18 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -485,6 +485,7 @@ static int traverseproto (global_State *g, Proto *f) { int i; if (f->cache && iswhite(f->cache)) f->cache = NULL; /* allow cache to be collected */ + f->cachemiss = 0; /* restart counting */ markobjectN(g, f->source); for (i = 0; i < f->sizek; i++) /* mark literals */ markvalue(g, &f->k[i]); -- cgit v1.2.3-55-g6feb