aboutsummaryrefslogtreecommitdiff
path: root/lbuffer.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-11-10 13:40:46 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-11-10 13:40:46 -0200
commit0c725b2492051bdb776af3dae31881a162000894 (patch)
treed24b9106614f9c54a6ea75a57acdd0ab58964b5c /lbuffer.c
parentd915cf4f9dbe525f8faeb4cb04df13d5f08692da (diff)
downloadlua-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.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lbuffer.c b/lbuffer.c
index 85568b3c..181056f8 100644
--- a/lbuffer.c
+++ b/lbuffer.c
@@ -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
25static void Openspace (int size) { 25static 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