new scheme for buffers

This commit is contained in:
Roberto Ierusalimschy
2000-09-11 14:38:42 -03:00
parent 70c8a31092
commit 787a78f83e
13 changed files with 399 additions and 234 deletions

View File

@@ -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;