From 787a78f83e0484c9e9698189982e2f309808fae8 Mon Sep 17 00:00:00 2001
From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 11 Sep 2000 14:38:42 -0300
Subject: new scheme for buffers

---
 lobject.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'lobject.c')

diff --git a/lobject.c b/lobject.c
index c833e921..7f3d71fc 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
 /*
-** $Id: lobject.c,v 1.44 2000/08/09 19:16:57 roberto Exp roberto $
+** $Id: lobject.c,v 1.45 2000/08/11 16:17:28 roberto Exp roberto $
 ** Some generic functions over Lua objects
 ** See Copyright Notice in lua.h
 */
@@ -9,7 +9,9 @@
 
 #include "lua.h"
 
+#include "lmem.h"
 #include "lobject.h"
+#include "lstate.h"
 
 
 /*
@@ -53,6 +55,15 @@ int luaO_equalObj (const TObject *t1, const TObject *t2) {
 }
 
 
+char *luaO_openspace (lua_State *L, size_t n) {
+  if (n > L->Mbuffsize) {
+    luaM_reallocvector(L, L->Mbuffer, n, char);
+    L->Mbuffsize = n;
+  }
+  return L->Mbuffer;
+}
+
+
 static double expten (unsigned int e) {
   double exp = 10.0;
   double res = 1.0;
-- 
cgit v1.2.3-55-g6feb