code for string cache generalized for "associative sets" (compiler

will optimize away or inline the extra loops)
This commit is contained in:
Roberto Ierusalimschy
2015-09-22 11:18:24 -03:00
parent 0f1f51be4b
commit 9fae7b6d3f
4 changed files with 36 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lstate.h,v 2.123 2015/07/04 16:33:17 roberto Exp roberto $
** $Id: lstate.h,v 2.124 2015/09/08 15:41:05 roberto Exp roberto $
** Global State
** See Copyright Notice in lua.h
*/
@@ -140,7 +140,7 @@ typedef struct global_State {
TString *memerrmsg; /* memory-error message */
TString *tmname[TM_N]; /* array with tag-method names */
struct Table *mt[LUA_NUMTAGS]; /* metatables for basic types */
TString *strcache[STRCACHE_SIZE][1]; /* cache for strings in API */
TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */
} global_State;