diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-02-25 16:13:56 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-02-25 16:13:56 -0300 |
| commit | 4b954e9b2e82e7b7a03216f06ebad71d5d8bd948 (patch) | |
| tree | 2be9b660f626f14ddd23fd21e68b61ae1cb081dc | |
| parent | 055823c04d09f6da0df1d7b5761609f749042907 (diff) | |
| download | lua-4b954e9b2e82e7b7a03216f06ebad71d5d8bd948.tar.gz lua-4b954e9b2e82e7b7a03216f06ebad71d5d8bd948.tar.bz2 lua-4b954e9b2e82e7b7a03216f06ebad71d5d8bd948.zip | |
details (from lhf)
| -rw-r--r-- | lbuffer.c | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbuffer.c,v 1.5 1998/12/28 13:44:54 roberto Exp roberto $ | 2 | ** $Id: lbuffer.c,v 1.6 1999/02/25 15:17:01 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 | */ |
| @@ -17,11 +17,14 @@ | |||
| 17 | -------------------------------------------------------*/ | 17 | -------------------------------------------------------*/ |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | #define EXTRABUFF 32 | ||
| 21 | |||
| 22 | |||
| 20 | #define openspace(size) if (L->Mbuffnext+(size) > L->Mbuffsize) Openspace(size) | 23 | #define openspace(size) if (L->Mbuffnext+(size) > L->Mbuffsize) Openspace(size) |
| 21 | 24 | ||
| 22 | static void Openspace (int size) { | 25 | static void Openspace (int size) { |
| 23 | lua_State *l = L; /* to optimize */ | 26 | lua_State *l = L; /* to optimize */ |
| 24 | l->Mbuffsize = l->Mbuffnext+size; | 27 | l->Mbuffsize = l->Mbuffnext+size+EXTRABUFF; |
| 25 | l->Mbuffer = luaM_growvector(l->Mbuffer, l->Mbuffnext, size, char, | 28 | l->Mbuffer = luaM_growvector(l->Mbuffer, l->Mbuffnext, size, char, |
| 26 | memEM, MAX_INT); | 29 | memEM, MAX_INT); |
| 27 | } | 30 | } |
