Browse Source

details (from lhf)

Roberto Ierusalimschy 26 years ago
parent
commit
4b954e9b2e
1 changed files with 5 additions and 2 deletions
  1. 5 2
      lbuffer.c

+ 5 - 2
lbuffer.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lbuffer.c,v 1.5 1998/12/28 13:44:54 roberto Exp roberto $
+** $Id: lbuffer.c,v 1.6 1999/02/25 15:17:01 roberto Exp roberto $
 ** Auxiliary functions for building Lua libraries
 ** Auxiliary functions for building Lua libraries
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -17,11 +17,14 @@
 -------------------------------------------------------*/
 -------------------------------------------------------*/
 
 
 
 
+#define EXTRABUFF	32
+
+
 #define openspace(size)  if (L->Mbuffnext+(size) > L->Mbuffsize) Openspace(size)
 #define openspace(size)  if (L->Mbuffnext+(size) > L->Mbuffsize) Openspace(size)
 
 
 static void Openspace (int size) {
 static void Openspace (int size) {
   lua_State *l = L;  /* to optimize */
   lua_State *l = L;  /* to optimize */
-  l->Mbuffsize = l->Mbuffnext+size;
+  l->Mbuffsize = l->Mbuffnext+size+EXTRABUFF;
   l->Mbuffer =  luaM_growvector(l->Mbuffer, l->Mbuffnext, size, char,
   l->Mbuffer =  luaM_growvector(l->Mbuffer, l->Mbuffnext, size, char,
                                 memEM, MAX_INT);
                                 memEM, MAX_INT);
 }
 }