diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-09-08 12:41:05 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-09-08 12:41:05 -0300 |
commit | 41964648eea1427d53934b886abb68cc8457b019 (patch) | |
tree | b0388dfebe6614d5d49306193faf78f8b9e1a6a1 /lstate.c | |
parent | 502214f8a551cd01d94677f98a40aa51531ef71d (diff) | |
download | lua-41964648eea1427d53934b886abb68cc8457b019.tar.gz lua-41964648eea1427d53934b886abb68cc8457b019.tar.bz2 lua-41964648eea1427d53934b886abb68cc8457b019.zip |
long strings are created directly in final position when possible
(instead of using an auxiliar buffer to first create the string
and then allocate the final string and copy result there)
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.128 2015/03/04 13:31:21 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.129 2015/07/13 13:30:03 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -241,7 +241,6 @@ static void close_state (lua_State *L) { | |||
241 | if (g->version) /* closing a fully built state? */ | 241 | if (g->version) /* closing a fully built state? */ |
242 | luai_userstateclose(L); | 242 | luai_userstateclose(L); |
243 | luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); | 243 | luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); |
244 | luaZ_freebuffer(L, &g->buff); | ||
245 | freestack(L); | 244 | freestack(L); |
246 | lua_assert(gettotalbytes(g) == sizeof(LG)); | 245 | lua_assert(gettotalbytes(g) == sizeof(LG)); |
247 | (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ | 246 | (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ |
@@ -310,7 +309,6 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | |||
310 | g->strt.size = g->strt.nuse = 0; | 309 | g->strt.size = g->strt.nuse = 0; |
311 | g->strt.hash = NULL; | 310 | g->strt.hash = NULL; |
312 | setnilvalue(&g->l_registry); | 311 | setnilvalue(&g->l_registry); |
313 | luaZ_initbuffer(L, &g->buff); | ||
314 | g->panic = NULL; | 312 | g->panic = NULL; |
315 | g->version = NULL; | 313 | g->version = NULL; |
316 | g->gcstate = GCSpause; | 314 | g->gcstate = GCSpause; |