diff options
Diffstat (limited to 'lmem.c')
| -rw-r--r-- | lmem.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lmem.c,v 1.53 2002/04/22 14:40:23 roberto Exp roberto $ | 2 | ** $Id: lmem.c,v 1.54 2002/05/01 20:40:42 roberto Exp roberto $ |
| 3 | ** Interface to Memory Manager | 3 | ** Interface to Memory Manager |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | #include "lua.h" | 10 | #include "lua.h" |
| 11 | 11 | ||
| 12 | #include "ldebug.h" | ||
| 12 | #include "ldo.h" | 13 | #include "ldo.h" |
| 13 | #include "lmem.h" | 14 | #include "lmem.h" |
| 14 | #include "lobject.h" | 15 | #include "lobject.h" |
| @@ -34,7 +35,7 @@ void *luaM_growaux (lua_State *L, void *block, int *size, int size_elems, | |||
| 34 | else if (*size >= limit/2) { /* cannot double it? */ | 35 | else if (*size >= limit/2) { /* cannot double it? */ |
| 35 | if (*size < limit - MINSIZEARRAY) /* try something smaller... */ | 36 | if (*size < limit - MINSIZEARRAY) /* try something smaller... */ |
| 36 | newsize = limit; /* still have at least MINSIZEARRAY free places */ | 37 | newsize = limit; /* still have at least MINSIZEARRAY free places */ |
| 37 | else luaD_runerror(L, errormsg); | 38 | else luaG_runerror(L, errormsg); |
| 38 | } | 39 | } |
| 39 | newblock = luaM_realloc(L, block, | 40 | newblock = luaM_realloc(L, block, |
| 40 | cast(lu_mem, *size)*cast(lu_mem, size_elems), | 41 | cast(lu_mem, *size)*cast(lu_mem, size_elems), |
| @@ -53,7 +54,7 @@ void *luaM_realloc (lua_State *L, void *block, lu_mem oldsize, lu_mem size) { | |||
| 53 | block = NULL; | 54 | block = NULL; |
| 54 | } | 55 | } |
| 55 | else if (size >= MAX_SIZET) | 56 | else if (size >= MAX_SIZET) |
| 56 | luaD_runerror(L, "memory allocation error: block too big"); | 57 | luaG_runerror(L, "memory allocation error: block too big"); |
| 57 | else { | 58 | else { |
| 58 | block = l_realloc(block, oldsize, size); | 59 | block = l_realloc(block, oldsize, size); |
| 59 | if (block == NULL) { | 60 | if (block == NULL) { |
