diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-11-10 13:40:46 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-11-10 13:40:46 -0200 |
commit | 0c725b2492051bdb776af3dae31881a162000894 (patch) | |
tree | d24b9106614f9c54a6ea75a57acdd0ab58964b5c /lbuffer.c | |
parent | d915cf4f9dbe525f8faeb4cb04df13d5f08692da (diff) | |
download | lua-0c725b2492051bdb776af3dae31881a162000894.tar.gz lua-0c725b2492051bdb776af3dae31881a162000894.tar.bz2 lua-0c725b2492051bdb776af3dae31881a162000894.zip |
buffer can shrink when too big
Diffstat (limited to 'lbuffer.c')
-rw-r--r-- | lbuffer.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuffer.c,v 1.8 1999/02/25 19:20:40 roberto Exp roberto $ | 2 | ** $Id: lbuffer.c,v 1.9 1999/02/26 15:48:55 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -24,9 +24,8 @@ | |||
24 | 24 | ||
25 | static void Openspace (int size) { | 25 | static void Openspace (int size) { |
26 | lua_State *l = L; /* to optimize */ | 26 | lua_State *l = L; /* to optimize */ |
27 | size += EXTRABUFF; | 27 | l->Mbuffsize = (l->Mbuffnext+size+EXTRABUFF)*2; |
28 | l->Mbuffsize = l->Mbuffnext+size; | 28 | luaM_reallocvector(l->Mbuffer, l->Mbuffsize, char); |
29 | luaM_growvector(l->Mbuffer, l->Mbuffnext, size, char, arrEM, MAX_INT); | ||
30 | } | 29 | } |
31 | 30 | ||
32 | 31 | ||