diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-09-11 14:38:42 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-09-11 14:38:42 -0300 |
commit | 787a78f83e0484c9e9698189982e2f309808fae8 (patch) | |
tree | 0682eddf4ea5a49bf5078bac937a36f90057df57 /lobject.c | |
parent | 70c8a310925d6c41c3ef4f7feeae604a4c9a3a95 (diff) | |
download | lua-787a78f83e0484c9e9698189982e2f309808fae8.tar.gz lua-787a78f83e0484c9e9698189982e2f309808fae8.tar.bz2 lua-787a78f83e0484c9e9698189982e2f309808fae8.zip |
new scheme for buffers
Diffstat (limited to 'lobject.c')
-rw-r--r-- | lobject.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.c,v 1.44 2000/08/09 19:16:57 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 1.45 2000/08/11 16:17:28 roberto Exp roberto $ |
3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -9,7 +9,9 @@ | |||
9 | 9 | ||
10 | #include "lua.h" | 10 | #include "lua.h" |
11 | 11 | ||
12 | #include "lmem.h" | ||
12 | #include "lobject.h" | 13 | #include "lobject.h" |
14 | #include "lstate.h" | ||
13 | 15 | ||
14 | 16 | ||
15 | /* | 17 | /* |
@@ -53,6 +55,15 @@ int luaO_equalObj (const TObject *t1, const TObject *t2) { | |||
53 | } | 55 | } |
54 | 56 | ||
55 | 57 | ||
58 | char *luaO_openspace (lua_State *L, size_t n) { | ||
59 | if (n > L->Mbuffsize) { | ||
60 | luaM_reallocvector(L, L->Mbuffer, n, char); | ||
61 | L->Mbuffsize = n; | ||
62 | } | ||
63 | return L->Mbuffer; | ||
64 | } | ||
65 | |||
66 | |||
56 | static double expten (unsigned int e) { | 67 | static double expten (unsigned int e) { |
57 | double exp = 10.0; | 68 | double exp = 10.0; |
58 | double res = 1.0; | 69 | double res = 1.0; |