From a80cada9142f9e967c710e37934067a708224161 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 4 Mar 2015 10:31:21 -0300 Subject: new cache for interning strings --- lstate.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index d42f0e82..3a9b8e98 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.126 2014/11/02 19:19:04 roberto Exp roberto $ +** $Id: lstate.c,v 2.127 2014/11/02 19:33:33 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -37,9 +37,6 @@ #endif -#define MEMERRMSG "not enough memory" - - /* ** a macro to help the creation of a unique random seed when a state is ** created; the seed is used to randomize hashes. @@ -200,12 +197,9 @@ static void f_luaopen (lua_State *L, void *ud) { UNUSED(ud); stack_init(L, L); /* init stack */ init_registry(L, g); - luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ + luaS_init(L); luaT_init(L); luaX_init(L); - /* pre-create memory-error message */ - g->memerrmsg = luaS_newliteral(L, MEMERRMSG); - luaC_fix(L, obj2gco(g->memerrmsg)); /* it should never be collected */ g->gcrunning = 1; /* allow gc */ g->version = lua_version(NULL); luai_userstateopen(L); -- cgit v1.2.3-55-g6feb